10-13-2023 10:12 AM
I am trying to get frequency counter data out of my Siglent 2042X waveform generator using NI LabView 2023 Q1 (32 bit) hobbyist edition. I am running windows 10. I am new to LabView. I have researched the knowledge base and tutorials but have not found a solution to the error that I am getting.
So far, I have set up the instrument with a USB connection and with NI MAX I am able to read and write "*IDN?/n" to the instrument without errors. See screen shot below.
I set up a basic open, write, read, close program that develops a time-out error at the read block. See below.
Any ideas of what I might do to fix the issue?
Regards,
Wes Winkler
10-13-2023 12:41 PM
Did you use the correct configuration (baud rate, termination character etc)?
Anyway, there is a library and example available at IDnet (Siglent Technologies SDG2042X Function Arbitrary Waveform Ge - Instrument Driver)
Download and extract the library to <LabVIEW>\instr.lib
Open and explore the example.
10-13-2023 06:33 PM
You need add a VISA property node to ‘Enable Termination character’ and also need to set the termination character to the numeric equivalent to \n.
https://www.ni.com/en/support/documentation/supplemental/06/termination-characters-in-ni-visa.html
Currently what is happening is the VISA read is just waiting for 1024 characters and it isn’t getting them all and timing out.
10-13-2023 06:41 PM
Also you need to check the string for ‘idn?\n’ has got ‘\ codes display’ enabled.
https://www.ni.com/docs/en-US/bundle/labview/page/backslash-codes-display.html
otherwise you are not sending what you think you are sending and the instrument doesn’t understand
10-14-2023 10:06 AM
That did it! thanks for the tip. I enabled the codes display and found that there were two backslashes. I removed the extra backslash and the program worked.
10-15-2023 01:01 AM
@Wes_Winkler wrote:
That did it! thanks for the tip. I enabled the codes display and found that there were two backslashes. I removed the extra backslash and the program worked.
Ahhhh! So you were sending a littoral "*IDN?\n" 7 characters rather than a "*IDN?" followed by the newline character 6 characters as shown in the test panel ("\\" is the escape code for a single Backslash character while "\n" is newline)