02-01-2023 10:43 PM
I have been trying to send a command to my instrument via LabView but it's not working as it is only working on the NI Max Visa Test Panel, What could I be doing wrong? I have attached pictures of the command I am trying to send, my block diagram, and the error I keep getting.
Solved! Go to Solution.
02-01-2023 11:04 PM
You clearly send different strings, but there is no way to really tell without seeing the actual vi. We can't even tell what the display style is for your string diagram constant.
Please attach your VI. Thanks.
02-02-2023 01:37 AM
You could have wrong settings, check the settings in NI MAX and use the same in your VI (maybe use "Visa configure serial port" function instead of "Visa Open" to specify the settings)
Possibly you have the wrong termination character specified.
02-02-2023 02:54 AM - edited 02-02-2023 02:59 AM
@altenbach wrote:
You clearly send different strings, but there is no way to really tell without seeing the actual vi. We can't even tell what the display style is for your string diagram constant.
It's actually worse. If the automatic wire probe shows backslashes then that is because there are backslashes in the sting, not escaped characters. The probe NEVER shows "\s" for a space character!
To the OP: Go in the front panel, right click on the string control and select "'\' Codes Display" in the popup menu. Then revalidate the string you see and make sure to change the double \ into single ones.
But I have to support Christian's request! If you want support for a problem, you need to post the VI itself, not a picture of it. It is often impossible to see the specific settings on LabVIEW objects in a picture. While this was possible to diagnose, it is a roundabout way of doing so, as we have to deduce things around a few corners to actually find the problem.
02-02-2023 09:32 AM - edited 02-02-2023 10:30 AM
As it's very common for a device to listen until it receives a termination character.
Basically the device you are talking to does not know you have stopped talking because you haven't told it you have stopped talking with a termination character.
02-02-2023 09:45 AM - edited 02-02-2023 09:47 AM
You are also actually reading after writing in your LabVIEW code and the error is a timeout waiting for a response. You only write to the instrument with NI-MAX. Maybe try a query and see if you get the same timeout?
Are you sure the instrument sends a response to the ALARM command?
02-05-2023 01:29 AM
I have attached my VI, I have been trying all possible solutions posted in this discussion, but none seem to work for me yet. Thank you for your help and support.
02-05-2023 11:15 AM - edited 02-05-2023 11:22 AM
@AETHER1 wrote:
I have attached my VI, I have been trying all possible solutions posted in this discussion, but none seem to work for me yet. Thank you for your help and support.
I doubt you have, else it would be working. Now you are attaching a VI that we've already seen, with all input fields blank. Enter what you think is correct into the control named "string" (I am sure there could be a better label name!), then "right-click...data operation...make current value default". Save and attach the VI once more. No we can see what you actually entered!
Your string is still in normal display. Have you tried changing it to \-codes instead?
What do you get if you run the attached code (after entering the correct resource, of course)
02-05-2023 10:34 PM
It worked after setting the string to code display, thanks a lot!
02-05-2023 11:28 PM
How did you get "visa test panel" on NIMAX? My NIMAX does not have it.