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...