LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Chroma 16502 responds to serial command via NI MAX VISA Test Panel but no response with VISA functions.

Solved!
Go to solution

Hi,

 

I am able to get response to serial command from Chroma 16502 Ohmmeter, but when I create a VISA write and read in the LabVIEW then it errors out as Ream Timeout. 2 seconds is more than enough based on the settings from the NI MAX VISA Test Panel. Termination character is enabled by default and left to default value of 0x0A.

 

It is very simple code but I could not understand how to troubleshoot this. I verified the basic serial communication settings like Baudrate, parity, etc. matches with the device and VISA Test Panel but still, it is not working.

 

I have attached the snapshot of the serial settings for the VISA Test Panel along with the response to command IDN. Following is the block diagram I created.

LabVIEW_BlockDiagram.JPG

And, the error.

LabVIEW_Error.JPG

 Any help will be highly appreciated.

0 Kudos
Message 1 of 5
(505 Views)
Solution
Accepted by topic author SB_123

You forgot to append a termination chatacter to the commands you send to the device. Watch this video for a good introduction in serial communication in LabVIEW through VISA.

https://www.youtube.com/watch?v=J8zw0sS6i1c&t=1s

 

Rolf Kalbermatter
My Blog
Message 2 of 5
(467 Views)

@rolfk

Thank you for pointing that out.

I had tried '\n' at the end of the command but didn't try the concat string. Now, it is working and now I understand why.

0 Kudos
Message 3 of 5
(437 Views)

It's not the Concatenate String that solves this. Simply right click on the String constant with your *IDN? in it, select Visible Items->Display Style, then click on the glyph that appears on the left side of the box and select '\' Codes Display.

 

Now you can enter your string as "*IDN?\n" without concatenation and LabVIEW will send the command with the line feed character appended to the device.

The visible glyph will also show everybody what Display Style your constant has selected, even if you "only" post the image rather than the actual VI, so people don't need to download the VI to be able to check that you selected the right thing. 😁

 

"*IDN?\n" on a string constant selected to display Normal Display will NOT send a line feed to the device but simply the two characters '\' and 'n' which your device will find rather disturbing and simply generate an according error about this.

Rolf Kalbermatter
My Blog
Message 4 of 5
(431 Views)

Hi Rolf,

 

I never knew about the display style in string constant. This is new learning for me. Thank you for explaining in detail. I highly appreciate it.

 

And thank you for the video link. I will go through it as well as these kinds of small details do matter.

0 Kudos
Message 5 of 5
(418 Views)