Instrument Control (GPIB, Serial, VISA, IVI)

取消
显示结果 
搜索替代 
您的意思是: 

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 项奖励
1 条消息(共 6 条)
4,062 次查看
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 项奖励
2 条消息(共 6 条)
4,054 次查看
You also keep in mind that this way your device should react immediately after sending the data.  吃惊表情
 
I think it will work better if you add some delay after the send before you check the number of bytes available
3 条消息(共 6 条)
4,052 次查看
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 项奖励
4 条消息(共 6 条)
4,041 次查看
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 项奖励
5 条消息(共 6 条)
4,037 次查看

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 项奖励
6 条消息(共 6 条)
4,006 次查看