03-13-2012 10:34 PM
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
03-13-2012 11:08 PM
03-14-2012 03:58 AM
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
03-14-2012 04:20 AM
The device will need a little bit of time to receive the command, execute it and send the response.
03-14-2012 04:59 AM
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
03-15-2012 11:58 AM
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!
03-15-2012 12:26 PM
Here is my code
03-15-2012 01:11 PM
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.
03-15-2012 04:24 PM - edited 03-15-2012 04:25 PM
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.
03-18-2012 11:40 PM
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