LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Labview receive data from the serial port.

No. I can't.  Because there are plenty of examples already out there.  Search NI Help, Find Examples.  Producer/Consumer.  Search the forums.

0 Kudos
Message 11 of 14
(2,629 Views)

Running VI error like that, I do not know why

1.PNG

it seems to be missing

2.PNG

 

 

0 Kudos
Message 12 of 14
(2,621 Views)

Because you didn't read what I wrote in message 3 and elaborated on in message 6

 

Let me use capital letters like I usually do.  DON'T USE BYTES AT PORT!

 

You have an incomplete message.  You checked if bytes at port are greater than 0.  Well if only a few came in, it is greater than 0.  Then you proceed to read that many bytes.  Guess what?  Incomplete message, and data that doesn't fit the format string!  Error 85.

 

Reread the last paragraph of message 6 "If you have a small while loop that continually reads bytes at port to determine when a message starts (Bytes at Port >0), then you can stop the while loop and proceed to a VISA Read where you read a specific number of bytes (not the value coming from Bytes at port)."

Your implementation of a case structure in a while loop works okay as well as long as you put a small wait statement in the false case.

 

1.  Delete the wire that goes from Bytes at Port to VISA Read.

2.  Right click on the VISA Read byte count and put in a large number.  Such as 1000.

3.  Put a wait function of a few thousand milliseconds in your false case as you don't need that loop burning up your CPU checking bytes at port waiting for a byte to arrive.

4.  Edit your VI name.  "Camera".  Not "Cammera".  There aren't 2 "m"'s.

 

gamma_Cammera_BD

 

 

Message 13 of 14
(2,604 Views)

Thank you i ran the program and it no longer has errors.

1234.PNG

It has been done but now I want to optimize the program more than using Byte at port and a case function. I have no other idea, do you have another way.

 

0 Kudos
Message 14 of 14
(2,587 Views)