From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
09-27-2008 07:26 AM
09-29-2008 11:37 AM
i tried this and it seems to work. but one problem. it only work when i view it in HIGHTLIGHTS. if i dont run it in hightlight. i will get NOTHING for the NUMERIC RESPONSE STRING.
i had to make some cases different in order to stop the 2nd while loop.
09-29-2008 12:07 PM
You are not paying enough attention as to how the example Dennis gave you is laid out.
In your first loop, one of those timing functions needs to be inside the loop
09-29-2008 12:36 PM - edited 09-29-2008 12:37 PM
oh. i didnt know that leaving it in or outside the loop makes a different. but when you think about it. its race condition. but that didnt solve the issue
this is dennis example.
everytime i run this
my bytes at port value is greater than 0, or it is 0
if my timeout = 0, the Get Time value in the first while loop is greater than 0 making it True.
that makes TRUE/FALSE case, True and it will timeout
Therefore I have to make the Get Time Value to be Less or Equal the Timeout value so that it will be False
and Bytes at Port = 0, making True to stop the first while loop or else it will not stop if Bytes at port =0.
and going into the case structure. if bytes of port = 0, making the case inside the while loop True will be nothing.
however, i changed those conditions and seems that it will only work in HIGHTLIGHT and not on just the Run button.
why is that?
09-29-2008 12:48 PM
Why is your timeout equal to zero? It should be some kind of value greater than zero, perhaps a couple of seconds!! Otherwise it is essentially always the timed out case.
Make your comparison >= like in Dennis' example. Make your timeout control have some kind of value besides 0.
Try again.
09-29-2008 12:56 PM - edited 09-29-2008 01:01 PM
hmmm...how wierd. everything works now..
for this example.
thank you guys. i have to go debug and see if this VISA will work with all the system.
09-29-2008 01:19 PM - edited 09-29-2008 01:23 PM
okay.
when i use VISA.
I run into this error code.
do you know how to debug that?
09-29-2008 01:40 PM
That is warning, not an error. It indicates that you read all the bytes you requested. If you terminate a read with a termination character, then the VISA Read assumes that you got all the message because it was terminated. The warning tells you that the sending device might be sending more characters than the number requested to be read.
Note that the Status boolean is NOT indicating an error. You can safely ignore the warning.
Lynn
09-29-2008 01:49 PM - edited 09-29-2008 01:50 PM
|
09-29-2008 01:52 PM - edited 09-29-2008 01:52 PM