LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Basic serial write and read

In the block diagram of example Basic Serial Write and Read, there is a function called "Instr" which is used to set and Bytes at Port of VISA Read. My question is why the Bytes at Port of VISA cannot be directly set thru a Numeric Constant? Is it due to a kind of scope problem?

Secondly, I find that the output of the read buffer is of string type instead of number. On that note, a Hex String to Number Converter is required in oder to plot the value or display it. Is my understanding correct?

Many thanx in advance,

win2s
0 Kudos
Message 1 of 6
(2,782 Views)
What you are looking at is an instrument property node. It is used to determine how many bytes are sent BACK by the instrument, so
you know how many to read in the following vi (otherwise you don't really know when you are done reading).

The type of conversion of the resulting output depends on the details of your particular instrument.
0 Kudos
Message 2 of 6
(2,773 Views)
Thanx for your reply.
Perhaps I miss your point. I still don't know why man cannot direct feed a Numeric Constant to the byte count of the VISA Read. In that example where is the comparison between the actual read byte number and the specified number conducted? Sorry for these newbie question. win2s
0 Kudos
Message 3 of 6
(2,752 Views)
You can wire a constant to the number of bytes to read. If you know exactly what the instrument will return for each command you send, then you can use a constant. The problem with that is that it is often impossible to know how many bytes to expect but that's instrument and command dependent. It's also quite simple to use the VISA Bytes at Serial Port instead of bothering to count. Best is when the instrument sends a termination character at the end of each response. Then you can specify a large number of bytes to read and the VISA Read will automatically terminate when the termination character is detected.
0 Kudos
Message 4 of 6
(2,747 Views)
It's a clear. Could you tell me how and where could I set the VISA read at asynchronous or synchronous?
0 Kudos
Message 5 of 6
(2,721 Views)
Just right click on the VISA Read icon.
0 Kudos
Message 6 of 6
(2,717 Views)