Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

string question

Hi guys!
 
I have a problem with my serial communication. The picture on which I refer to is attached and the problem is signed with a red circle.
If I write the command ":VOLT 10;" to communicate with my power supply device to both figures, it will just work with the above one.
WHY????Both commands have the same string format...
 
I would really appreciate your help.
 
Thanks, Nobby
0 Kudos
Message 1 of 6
(3,926 Views)
You wrote :VOLT 10; in your text but in the diagram the value of the constant is :VOLT?;. Is this an error in the text ?

Could you please wire the control and the constant to an Equal? function to check if the strings are really identical ?
0 Kudos
Message 2 of 6
(3,918 Views)
You also keep in mind that this way your device should react immediately after sending the data.  Smiley Surprised
 
I think it will work better if you add some delay after the send before you check the number of bytes available
Message 3 of 6
(3,916 Views)
Hey JB and KC!
 
Thank you for your answer. I have tried your advices, but that problem still occurs...
What else should I do?
 
Cheers,
 
Nobby
0 Kudos
Message 4 of 6
(3,905 Views)
I was so focused on this "control vs constant" question that I missed the very important point mentionned by K C. Five stars for him !

  • Does the code work at 100% with the control and never when using the constant ?
  • Is the output of the comparison TRUE ?
  • Is it still TRUE if you remove the string length functions and directly wire the control and the constant to Equal? ?

Could you please make the current values default (LV menu >> Edit >> make Current Values Default), save the VI and post it ?
0 Kudos
Message 5 of 6
(3,901 Views)

Nobby,

Make sure that your string control does not have more that one line of text in it.  It is very easy to hit the enter key and up with stuff in the string control that is hidden.  One quick way to check this is to wire your string control to an indicator and run the vi.

You can right click the string control on the front panel and select "limit to single line" to prevent this.

0 Kudos
Message 6 of 6
(3,870 Views)