LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

problem interpretation of data from serial data.... help please!

Do some experiments, decreasing as much as you can the timeout value, until you get serial com errors (nul data will appear), then use a doubled or tripled value as security. Or directly decide that 200 ms is correct
If there is no lag on your plc, you are sending 6 bytes in about 10 ms. This should leave you some room to play...

I think that bthis will be our last exchange 🙂
Glad you did it !
Keep wiring and stay connected on this forum. And try to share your knowledge with others.

CC
Chilly Charly    (aka CC)
Message 41 of 57
(2,150 Views)
Hi CC,

I got it, finally i put status output error on queue vi, and put in the stop loop. So, when the queue vi get any error directly stop the vi. So it is perfect!.

Thank you very much for your patiente with me, and you help!.
My full program is now very good, almost real time. ITs dyno software, i get diferent graph, save data, other windows.... I got it in 2 years, but the project is finished.
Only new improvements in the future...

Regards,Fonsi.
Message 42 of 57
(2,142 Views)
Sorry, I come at the end of the discussion. I'll experiment with serial port and microcontroller soon.
Can you post your final vi as en example?

Thanks,
David
0 Kudos
Message 43 of 57
(2,127 Views)
Hi,

Use the last vi, i put in the postages... its correct. Even this changes are only for my aplication, for use the serial port with pic, the examples are very eficient to get it.

i hope it help you!. For me helpped a lot.

Regards,Fonsi.
0 Kudos
Message 44 of 57
(2,122 Views)
Hi Fonsi or anyone else who has the Fonsi's last code,

I have an older version of LabVIEW (6.1) and cannot open the last code of Fonsi, since it was written in 7.1 version.
I'd appreciate so much if anyone saved the file in 6.1 or any lover version of LbVIEW. I have my deadline (very soon) to finish my application. I am in urgent need of help.

Thanks in advance
0 Kudos
Message 45 of 57
(2,073 Views)
Here is a 6.1 version. No garantee...

CC
Chilly Charly    (aka CC)
Message 46 of 57
(2,066 Views)
Dear CC,

I got the evaluation software of version 7 and opened the file you sent me. It is already enough for me to get the gist of the code, i can still try to open it in 6.1 professional version, if i need it.
I appreciate very much and have a wonderful day.
0 Kudos
Message 47 of 57
(2,063 Views)
Hello, i have wrote about my problem under a new thread but couldn't get any help so far. I am in need of URGENT help with my LabVIEW code, please help me anyone reads this by any chance!

In my application, i need to control the speed of a DC motor using a Motorola kind microcontroller (MC). In the mean time, i also need to read the output data of 2 sensors (force and displacement) from an Analog to Digital Conv. ADC (by talking to the same serial port)- data from the displacement sensor will be used for the feedback control of DC speed.

In order to stimulate the sensors and collect the data out in a PC using LabVIEW by a serial communication, i need to start running the DC first. The way i programmed the microcontroller is as follows;

The "SerialMC VI" sends the following characters to the MC:

"\s" when the "Forward DC motion start button" is pressed, followed subsequently by
"\r" at a rate sufficient to download data as it is collected until the motor stops.
When we want to motor to rewind;
"\b" at the time the "Reverse DC motion start button" is pressed.

Upon recieving "\s", my code will clear memory, make the carriage start moving forward and collecting data.
Everytime an "\r" is recieved, it will send a block of data points to the PC
Upon recieving a "\b", no sensor data collection will be done but just the carriage will move back to its starting place.

As you can see in my "SerialMC VI", in the frame 0, i want to write the 3 different commands in the order specified above by using 3 input strings. Also, as you can see my 2 push buttons ("Forward DC motion start button" and "Reverse DC motion start button") are in frame 1 in while loop. Do i need to use an "Event Structure" to put the push buttons in an order? If yes how? If not, what should i do? And how should i set the 2 push buttons and 3 write strings (how do the buttons and command strings communicate)? Could you please guide me or make the changes in my code?

For the second part of the VI; I know that i'll get the data in ASCII characters. Therefore, i used a "Type Cast" function to have the data in integer format. Then, i want to write the data in two columns in a text file, using "Write to Spreadsheet File" function but i couldn't do that.

And the last two things i want to do is;
Plot the graph of "Force vs. Displacement" and the chart of Force vs. time" after getting the force and displacement data in a 2D array. How can i do these?

I have to get this communication very soon, i am new to LabVIEW and have spent so much time to understand it but i cannot go on any further, i am stuck at this point. Please help me. I have the LabVIEW 6.1 version, in case you make any changes. I really appreciate your help.

Regards...
0 Kudos
Message 48 of 57
(2,037 Views)
Do you have the specs or manual for the microcontroller commands?? I need to see some more documentation. Here is a vi that uses VISA to acquire data from a YOKOGAWA DL708 digital oscilloscope. Open some of the sub vi's and look at how the VISA communication is done. This is in 7.0 format. Start with the first vi in the list when you open the llb file.
0 Kudos
Message 49 of 57
(2,015 Views)
Sorry about that, I just saw that you are using 6.1 version. Here is a 6.1 version of a VISA write command. I don't think you want to write all of the commands at one time. When you send a command, a small time delay may be required before sending the next command. I really need to see the command format that needs to be sent.
Message 50 of 57
(2,012 Views)