04-21-2009 09:50 AM - edited 04-21-2009 09:56 AM
The 28 byte maximum length of the TE command text beginsimmediately after the TE. Internally, the C4 accepts all characters up to the first
terminator (See '7.3.3). When the string is processed, all leading blank characters arestripped and then one leading space is placed between the TE and string upon return.
Thus, all of the following:
TE123 -45,6<CR><LF> no leading space
TE 123 -45,6<CR><LF> one leading space
TE 123 -45,6<CR><LF> multiple leading spacesreturn
TE 123 -45,6<CR><LF>
Solved! Go to Solution.
04-21-2009 09:57 AM
04-21-2009 10:03 AM
Thanks for the quick reply!
How do i know if the termination character enbale is on or off? what does that mean? Visa read just sits there, and times out. its not 20 seconds, but its definately a length of time.
When I send commands to the instrument, I always send (for example) "TE Done!\r\n".
Besides changing the 8 characters to 7, what else should i do?
04-21-2009 10:08 AM
04-21-2009 10:26 AM
lebogzy wrote:
How do i know if the termination character enbale is on or off? what does that mean?
The termination character (if enabled) can used by the VISA Read to know when to stop reading. Thus, if you enable it, and set it to linefeed, then the VISA Read will stop reading once it sees a linefeed character on the serial port, even if you wired a larger value to the byte count input than you. Thus, if you wire a really large number (like 200) to the byte count input, and you've enable linefeed, and the VISA Read sees a linefeed after, say, 18 characters, then that's all that you will get. The VISA Read will not sit there until it fills up with 200 bytes. If the termination character is disabled, then the VISA Read will explicitly wait until it has the same number of bytes that you've wired to the byte count input. If it doesn't get that many by a certain time, it will time out. The timeout value is programmable.
How do you know if the termination character is enabled, and what it's set to? That would be wherever the VISA session is opened and configured. Based on your latest screenshot, this would be in the "Initialize" VI all the way to the left.
When I send commands to the instrument, I always send (for example) "TE Done!\r\n".
I have no idea what this means, or whether it's right, as I don't have the documentation for that instrument.
Besides changing the 8 characters to 7, what else should i do?
It depends. The latest screenshot you provided now has a value of 6. Where did you get this code? Is this something you modified?
04-21-2009 10:58 AM - edited 04-21-2009 10:59 AM
Attached is the 'initialize' vi. The commands i send to the instrument are correct, syntax wise. I always terminate them with a \r\n and didnt even realise this was something that was externally configured.
The problem with the visa read portion is that its only going to recieve the text once, every 45 minutes. Does that mean it will keep timing out for the duration of that time?
As for the code, most of it is mine with the exclusion of a subVI's which i downloaded from the application example online.
Thanks for baring with me, i've been using labview for just under a week now 🙂
As for the 6 bytes now, i got rid of the exlcamation mark. So now the oven should only send "Done" \r\n
04-21-2009 01:23 PM
That does not appear to do any kind of configuration of the serial parameters for a VISA session, so you'll get the default values. By default, termination character is disabled.
Since you receive the "Done" message every 45 minutes, and not as a response to a command, it doesn't make sense to have the VISA Read trying to read the message after you send the command. You will need to have a separate loop that monitors the serial port for that message. This loop should use the VISA Bytes at Serial Port to determine if there's anything on the port to read. How it's supposed to be synchronized with whatever you're doing I can't really say because I don't really know what your overall process is doing.
04-21-2009 02:22 PM
gotcha.
however i'm usign GPIB. Will visa bytes still work?
04-21-2009 02:55 PM
<Sound of head thumping on table>
For some reason I thought you were using serial. Forget everything I said about termination characters. You'll still need the part about needing the separate loop if you don't expect a response after each command, but only "every once in a while".
04-21-2009 08:04 PM - edited 04-21-2009 08:04 PM
smercurio_fc wrote:<Sound of head thumping on table>
For some reason I thought you were using serial.
I thought so too. It was never mentioned until much later in his 5th reply (#8 overall) that it was actually GPIB and not serial. And the screenshots gave no indication either.