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 » Sat Jan 13, 2018 11:08 pm

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
Site Admin
Site Admin
Posts: 2829
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire

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

Post by Hitesh » Mon Jan 15, 2018 1:30 pm

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,
Hitesh

Technical Support Engineer

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 » Mon Jan 15, 2018 2:57 pm

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 » Tue Jan 16, 2018 7:02 pm

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
Site Admin
Site Admin
Posts: 2829
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire

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

Post by Hitesh » Wed Jan 17, 2018 9:40 am

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,
Hitesh

Technical Support Engineer

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 » Wed Jan 17, 2018 9:11 pm

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

Hitesh
Site Admin
Site Admin
Posts: 2829
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire

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

Post by Hitesh » Fri Jan 19, 2018 10:13 am

Hi jw_666,

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

Thanks,
Hitesh

Technical Support Engineer

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 » Mon Jan 22, 2018 7:36 pm

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

Hitesh
Site Admin
Site Admin
Posts: 2829
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire

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

Post by Hitesh » Tue Jan 23, 2018 12:43 pm

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,
Hitesh

Technical Support Engineer

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 » Tue Jan 23, 2018 5:55 pm

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

- jw_666

Hitesh
Site Admin
Site Admin
Posts: 2829
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire

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

Post by Hitesh » Wed Jan 24, 2018 3:24 pm

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,
Hitesh

Technical Support Engineer

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 » Wed Jan 24, 2018 4:31 pm

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
Site Admin
Site Admin
Posts: 2829
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire

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

Post by Hitesh » Thu Jan 25, 2018 9:34 am

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,
Hitesh

Technical Support Engineer

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 » Thu Jan 25, 2018 4:46 pm

Screenshots_2.zip
(224.95 KiB) Downloaded 78 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: 3345
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 » Thu Jan 25, 2018 9:29 pm

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