07-11-2008 11:11 AM
07-11-2008 11:14 AM
VI_ATTR_ASRL_END_IN indicates the method used to terminate read operations.
- If it is set to VI_ASRL_END_NONE, the read will not terminate until all of the requested data is received (or an error occurs).
- If it is set to VI_ASRL_END_LAST_BIT, the read will terminate as soon as a character arrives with its last bit set. For example, if VI_ATTR_ASRL_DATA_BITS is set to 8, the read will terminate when a character arrives with the 8th bit set.
- If it is set to VI_ASRL_END_TERMCHAR, the read will terminate as soon as the character in VI_ATTR_TERMCHAR is received. In this case, VI_ATTR_TERMCHAR_EN is ignored.
Because the default value of VI_ATTR_TERMCHAR is 0Ah (linefeed), read operations on serial ports will stop reading whenever a linefeed is encountered. To change this behavior, you must change the value of one of these attributes—VI_ATTR_ASRL_END_IN or VI_ATTR_TERMCHAR.
07-11-2008 11:31 AM
07-14-2008 09:12 AM
Hi don Marco,
If you want to have a deepest view on the functionality of VISA API you can give a look to the following LabVIEW VISA Tutorial
I strongly recommend you to try and test first Serial functionality by using the 'Advanced Serial Write and Read.vi' you can find in the Ni Example Finder searching for 'serial' as searching keyword.
Hope this helps!
Best regards
Hudson | NIIT AE
09-26-2008 06:22 AM
Hi all,
I might be having a similar problem but I am not sure. i am using labview 8.0
I am trying to write a simple program that controls a SpectraPro 275. With this you can send a command like "?NM\r" to request for the wavelength position.
Using a simple write and read program I am able to send a request to the serial port; however the reply is that my request is incorrect.
using the same command on VISA resource settings, I get the right result.
Anybody has an idea on what might be wrong?
Below is my program if someone wants to have a look
09-26-2008 09:03 AM
What does this:
using the same command on VISA resource settings, I get the right result.
mean?
Off-hand I don't see anything immediately obvious that's wrong. Are you sure about the command? Usually the "?" is at the end.
Code comment: You are leaning too much on sequence frames. Other than the need to have that delay your sequence frame is completely unnecessary. If you replace the Wait (ms) function with the Time Delay function then you don't need any sequence structure since that function has error in/error out terminals.
09-26-2008 09:20 AM
09-26-2008 09:30 AM
09-26-2008 09:41 AM - edited 09-26-2008 09:43 AM
Oops, you're correct.
Maybe instead of \r, you need to send a \r or a \r\n. Have you tried the either of the shipping examples for serial?
09-26-2008 12:18 PM
to Denis,
I actually used the "\r\n" still doesn't work.
i am controlling a Spectrapro 275 and in the manual in order to send a request to the device you need to preceed your request with "?". So if I want to know at what wavelength the monochromator is i have to send the command "?NM\r"