LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VISA Write problem

New to the forum so please bear with me.....

I have a VICI Valco controller that accepts string commands such as "CW6" without the quotes.  Using the Basic Serial Write and Read vi available from the help files, I am able to manipulate the controller.  The exact string sent to the controller is "CWx\r\n" without the quotes where # is a number 1 <= x <= 8.  This works.

When I tried to concatenate 3 different strings together, the controller does not move.  I am concatenating "CW" + "x" + "\r\n".  I probed the wire from the concatenated string to the VISA Serial Write and the string being passed is identical to the string from my first example.

Any thoughts on why this form would not behave?
0 Kudos
Message 1 of 9
(3,353 Views)
Hi dbrown3,
welcome to the forum. Are you sure that you see the string in "Code Display" both times? Can you upload your vi, if the display not helps?
You should see the "\r\n" only in code display as this exactly that. In normal display it is an "end of line" costant.

Hope it helps.
Mike
0 Kudos
Message 2 of 9
(3,352 Views)
I am not looking at the code display.  I have a probe on the wire leading to the VISA Serial Write.  The probe display shows, when I insert 6 to the middle string, "CW6\r\n".  I realize that I might not need the \n because I am just feeding the VISA write a string and in fact when I tested it out on the original Basic Serial Write and Read, "CW6\r" was sufficient.

I am just confused as to why the identical string is not being acted upon.
0 Kudos
Message 3 of 9
(3,343 Views)

@MikeS81 wrote:
In normal display it is an "end of line" costant.

The "end of line" constant adapts to the operating system. On Windows it's CRLF, but on other platforms it's something else.
Message 4 of 9
(3,342 Views)
Hi dbrown3,
can you upload your vi, please?
Mike
0 Kudos
Message 5 of 9
(3,337 Views)
Here is the VI.  Basic Serial Write and Read works.  Basic Serial Write and Read2 does not.  The string passed to the VISA appears to be identical.

My intention is to cycle the number, change it from an integer to a string, and concatenate the string.
0 Kudos
Message 6 of 9
(3,290 Views)
My apologies...these should be the files...

The first set have too close a name to make it simple.

Serial Write Tester works

My Serial Write does not.
Download All
0 Kudos
Message 7 of 9
(3,284 Views)
You really did need to pay attenttion to the Code Display. Right click on the string control on the VI that works and you will see that it is set to '\' Code Display. Right click on the string constant with \r\n in your mod, and you will see that it is set to Normal Display. If you want to send a '\' code, you need to set the control/constant to '\' Code Display.
0 Kudos
Message 8 of 9
(3,280 Views)
I knew it was something simple that I had missed..

Thanks
0 Kudos
Message 9 of 9
(3,278 Views)