LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Why I use Serial communication in LabView it will run like a loop but I don't create a loop

I use Serial Communication example in LabView. It can run but I wonder why it already has config for serial Port, it run like a loop (after it writes and reads data, it run again) but I can not see a LOOP Structre.

Who can explaint it for me?

Thank you very much

0 Kudos
Message 1 of 16
(2,829 Views)
It will not run more than once unless you click on the run continuous button.
0 Kudos
Message 2 of 16
(2,826 Views)

Thank you for your answer.

So, when I click Run continuous, It means the dataflow will run from beginning to the end and repeat.

And can you explain me that why I need to put a delay between write and read from the Serial Port? If I don't do that I can't read data form the Serial Port trasnmitted form PIC microprocessor

 

0 Kudos
Message 3 of 16
(2,819 Views)

The device will need a little bit of time to receive the command, execute it and send the response.

0 Kudos
Message 4 of 16
(2,814 Views)

However, the Run Continously button should ONLY be used as a development and debugging tool. Use a while loop to get your program to cycle.

 

-CC 

----------------------------------------------------------------------------------------------------------------------------
"If anyone needs me, I'll be in the Angry Dome!"


0 Kudos
Message 5 of 16
(2,808 Views)

I have another trouble! I use period to set the time-solving for my program. But when I set the time less than the time my PIC microprocessor send, the value of read string is 0 but the PIC don't send any value. It is very strange. ( I also used many program to receive data form COM port but I never met that)

I want to keep the old value of read string (not zero)  and It will only be changed when the PIC send the new value. Please help me!

0 Kudos
Message 6 of 16
(2,772 Views)

Here is my code

0 Kudos
Message 7 of 16
(2,765 Views)

That is not code. It is an image. You did not even attach the correct type of image. If you had selected Edit>Create VI Snippet, you would create a png that you can drag to a block diagram and it becomes actual code.

 

In any case, if you read 0 bytes, you should not even execute the VISA Read, the conversion, and display. If you want to show all previous data read, then you need a shift register with the concantanate string function - again in a case statement where the number of bytes read is greater than 0.

Message 8 of 16
(2,756 Views)

TIP:

 

Don't use 8 index arrays and wire different constants to each one.

 

Use one index array.  Drag the bottom border downward as far as you need to.  Now you have multiple outputs.  You won't even need to put in constants because by default, the top one will be index 0, the one below that index 1, the one below that index 2, ....

 

 

Without being able to see how your front panel is laid out, you may not even want 8 individual LED's.  An array of LED indicators might be all you need.

0 Kudos
Message 9 of 16
(2,741 Views)

I try to add an resgister to save the data but I have a problem. When the period is less than the delay time I send from my PIC. the data receive will equal 0. I can not save the data when it do that.

Can you help me to fix that

0 Kudos
Message 10 of 16
(2,706 Views)