5442B to generate single instance of waveform from CSV file

Post your LabVIEW discussions here
Post Reply
jw_666
Newbie
Posts: 0
Joined: Thu Sep 28, 2017 3:08 pm

5442B to generate single instance of waveform from CSV file

Post by jw_666 »

Hello everyone,
I am seeking to generate a single pass of a waveform in the AWG mode. I have a saved csv file of my waveform. My file has 2500 points. I want it to run a single instance with LabVIEW and be done. I have tried to use the 5000 series example with no success. What setting am I missing for it run one shot of the waveform and be done?

-Thanks in advance.

Hitesh

Re: 5442B to generate single instance of waveform from CSV f

Post by Hitesh »

Hi jw_666,

You will need to setup the ps5000aSetSigGenArbitrary() function to output a single shot of the waveform on a trigger event (this can be scope input, external input or software trigger).

You may find this guide useful in conjunction with the Programmer's Guide.

Regards,

jw_666
Newbie
Posts: 0
Joined: Thu Sep 28, 2017 3:08 pm

Re: 5442B to generate single instance of waveform from CSV f

Post by jw_666 »

Great!
The AWG is spitting out one instance of the waveform. However in reality the whole waveform is 9.4 milliseconds long. The waveform I am getting out is roughly 3.2 milliseconds. The shape is accurate just not the timing. Would someone please point me in the correct direction?

jw_666
Newbie
Posts: 0
Joined: Thu Sep 28, 2017 3:08 pm

Re: 5442B to generate single instance of waveform from CSV f

Post by jw_666 »

Good afternoon all,
On page 84 of the 5000 Series Programmer's Guide the formula given is
outputFrequency = dacFrequency × ( deltaPhase / phaseAccumulator Size) ×
( awgBufferSize / arbitraryWaveformSize)

Is the dacFrequency constant regardless of the desired output frequency?

Thanks,
-jw666

Hitesh

Re: 5442B to generate single instance of waveform from CSV f

Post by Hitesh »

Hi jw666,

The DAC frequency is constant for the device.

You can use the ps5000aSigGenFrequencyToPhase() function to convert frequency to a delta phase value:

Code: Select all

PREF0 PREF1 PICO_STATUS PREF2 PREF3(ps5000aSigGenFrequencyToPhase)
	(
	int16_t												handle,
	double												frequency,
	PS5000A_INDEX_MODE						indexMode,
	uint32_t											bufferLength,
	uint32_t										* phase
	);
The function is not currently used in the AWG example that we provide but you can try adding a Call Function Library Node for this function.

Regards,

jw_666
Newbie
Posts: 0
Joined: Thu Sep 28, 2017 3:08 pm

Re: 5442B to generate single instance of waveform from CSV f

Post by jw_666 »

Hello Hitesh,
Sorry for the bother. I get an error code 1097 when I run this function.

Hitesh

Re: 5442B to generate single instance of waveform from CSV f

Post by Hitesh »

Hi jw_666,

Could you please post a screenshot of how you have defined this function in the Call Function Library Node?

Thanks,

jw_666
Newbie
Posts: 0
Joined: Thu Sep 28, 2017 3:08 pm

Re: 5442B to generate single instance of waveform from CSV f

Post by jw_666 »

Hitesh,
Sorry for the delay. attach is a snapshot of my code.
Attachments
FREQUENCY CALIBRATION.PNG
FREQUENCY CALIBRATION.PNG (9.88 KiB) Viewed 11603 times

Hitesh

Re: 5442B to generate single instance of waveform from CSV f

Post by Hitesh »

Hi jw_666,

No problem and thanks for the image.

Is this function being called after a connection has been established to the device as I noticed that the handle and other values are hardcoded?

If you could please right-click the Call Function Library Node and select Properties then obtain screenshots of the tabs of the dialog appears, that would be helpful.

Thanks,

jw_666
Newbie
Posts: 0
Joined: Thu Sep 28, 2017 3:08 pm

Re: 5442B to generate single instance of waveform from CSV f

Post by jw_666 »

Screenshots.zip
(88.72 KiB) Downloaded 398 times
This is the only VI used. I have included screenshots of the Call Function Library Node.

- jw_666

Hitesh

Re: 5442B to generate single instance of waveform from CSV f

Post by Hitesh »

Hi jw_666,

Thank you for posting the screenshots.

The ps5000aSigGenFrequencyToPhase() function returns a value corresponding to a PICO_STATUS code. Please change the return type to a signed or unsigned 32-bit Integer. The error is probably caused by there not being memory to write the value to.

Also the handle value should be a Signed 16-bit integer and the buffer length and phase should be unsigned 32-bit integer.

Regards,

jw_666
Newbie
Posts: 0
Joined: Thu Sep 28, 2017 3:08 pm

Re: 5442B to generate single instance of waveform from CSV f

Post by jw_666 »

Hi Hitesh,

I made the changes. I am still getting the error out of 1097. the return value of return type is 12. This value seems inaccurate. Any thoughts?
Attachments
Front panel.PNG

Hitesh

Re: 5442B to generate single instance of waveform from CSV f

Post by Hitesh »

Hi jw_666,

A return value of 12 indicates an invalid handle value.

Are you calling this function after the call to ps5000aOpenUnit()? If not, you will need to call the ps5000aSigGenFrequencyToPhase() function using the handle output from the Open Unit sub-vi which is used in our examples.

If you still get the error after doing the above, please post screenshots of the function prototype defined in the Call Function Library Node.

Thanks,

jw_666
Newbie
Posts: 0
Joined: Thu Sep 28, 2017 3:08 pm

Re: 5442B to generate single instance of waveform from CSV f

Post by jw_666 »

Screenshots_2.zip
(224.95 KiB) Downloaded 368 times
Hello Hitesh,
Progress is being made! I am learning a little bit as well. I am getting an error 5003. Does an error code chart exist in the 5000a programmers guide?

I have included screenshots of ps5000aSigGenFrequencyToPhase parameters and the ps5000aOpenUnit.

Thanks.
jw_666

Martyn
Site Admin
Site Admin
Posts: 4491
Joined: Fri Jun 10, 2011 8:15 am
Location: St. Neots

Re: 5442B to generate single instance of waveform from CSV f

Post by Martyn »

Please check the shared folder in the Labview directory on Github, the llb file contains the error codes.

5003 is Pico Not Found
Martyn
Technical Support Manager

Post Reply