LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I/O assistant doesn't function correctly every time

I have a  vi which controls a device through rs232.  In the end of the vi, I have a "reset" command, which never reset the device when I run the program.  I have tested the command with MAX and make sure that it's correct.  I tried to use a delay too.  I had a similar probem with the second "write" function before, it does not work every time, but it works now after I placed a time delay.  There is no error and I have no clue why it is not resetting my device.
 
Thank you
 
 
0 Kudos
Message 1 of 5
(3,191 Views)
Hi J2005,
You may want to try to use simple VISA functions in LabVIEW to only reset the device and see if it works that way.  Just open, configure, and write the reset command.  Leave all other functions out.  If this works correctly, there is something within the program preventing the command from being sent to the instrument correctly.  Since it is working in MAX, you may want to open NI Spy to see the exact command being sent to the instrument in MAX.  Then, run your program and use NI Spy again to capture the VISA functions containing the reset command.  You can compare these two and see if they are the same.  MAX may be automatically sending a termination character that your program isn't.  It sounds like something small, so hopefully we can track it down.  Please check the spy captures and try a simple program to reset the device and let me know if you are still having problems.  Best of luck and have a great day!
 
Chris R.
Applications Engineer
National Instruments
Chris R.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 5
(3,178 Views)

Hi,

I tried to use the open, config, write function instead of the I/O assistant.  It does not work either and still has no error.  I've never used NI-SPY before, so I am still trying to figure out how to use it now ...

Thank you,
 
J
0 Kudos
Message 3 of 5
(3,165 Views)
J - I noticed that all the other commands have a '\r' termination character at the end of the command, but the "RESET" command has a '\n'.  An easy way to tell this is to change the command constant strings to show '\' codes - do this by right clicking on the string constants and select "'\' Codes Display".

-Tommy

0 Kudos
Message 4 of 5
(3,157 Views)
Thank you very much Tommy!  That is the problem, the program works now :p
0 Kudos
Message 5 of 5
(3,146 Views)