LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

waituntil alternative in LabVIEW

I don't mean to be picky Dennis, but the code you posted won't work if it takes longer than a VISA timeout to read the 'A'. If the VISA read times out, it will generate an error which will be sent to the shift register. Now the next time through the loop, the read won't even execute because it will see an error in.
Message 11 of 29
(1,711 Views)
You're right. I have no idea how long it would take for the instrument to send the character but the best thing would be to put a VISA Bytes at Serial Port before the read and if bytes are greater than 0, do the read inside a case statement.

Message Edited by Dennis Knutson on 01-16-2007 12:16 PM

Message 12 of 29
(1,705 Views)
Hi
I have some questions regarding your program you sent me , I have  taged to questions ( labled them on there graph) could you answer them to me Please
Thanks....
Maple
0 Kudos
Message 13 of 29
(1,679 Views)

the screenshot is attched

 

 

0 Kudos
Message 14 of 29
(1,678 Views)

Hi Dennis

 

Thnaks alot for your help , does your program wait unti it recives an serial port Character B, ? I have some questions about the program that are labled with the graph of the program you gave me and it is attached to my post could you answer me them please

 

 

Thanks

 

Maple

0 Kudos
Message 15 of 29
(1,674 Views)
As the on-line help explains, VISA Bytes at Serial Port reads the number of bytes in the serial buffer and returns that value. If the value is greater than 0, a read is done. If the string returned contains the character 'B', then the while loop stops.
Message 16 of 29
(1,665 Views)

Dear Deninis

 

Thanks alot for your help, I will attach for you  a screenshot of the program you sent it , just asking when the case structure is false is this a proper wiring I have done , also to stop the loop what shall I wire to it ,

 

Thanks

0 Kudos
Message 17 of 29
(1,649 Views)

Since you said you want the while loop to run until the character is detected, the false case would have a False constant inside it. You could also right click on the exit tunnel and select Use Default if Unwired. The default is False but I usually prefer to explicitly provide a value.

Stopping a while loop and passing values through case statements are pretty basic elements in LabVIEW. I t sounds like you are just beginning so you might want to look at the resources available for learning LabVIEW at http://zone.ni.com/devzone/cda/tut/p/id/5199.

Message 18 of 29
(1,643 Views)
You may need to spend more time playing around with the serial port. After all we learn from our mistakesSmiley Wink.
Message 19 of 29
(1,624 Views)

Since you are not using a shift register for the error cluster, you probably don't need to check for an error condition and remove it. It's not very likely that an error would occur on a write anyway and if it did, you would probably want to detect that and stop. Also, you can wire your error cluster to the case statement selector input. The case statement changes colors and shows an Error (red) and No Error (green) case.

Message Edited by Dennis Knutson on 01-17-2007 12:17 PM

Message 20 of 29
(1,619 Views)