01-05-2010 02:04 AM
Hi to all,
Just want to ask, how are you going to create a feedback system in labview using 8051 microcontroller? Need to have a feedback from my microcontroller going to to my Labview program. Thanks.
01-05-2010 03:16 AM
01-05-2010 07:49 AM - edited 01-05-2010 07:49 AM
I think the simplest way is to use RS232 communication. However the data rate is somewhat limited with RS232. Please remember that you need a RS232 level translator between your uC and your PC serial port. Just Google MAX232
01-07-2010 09:50 PM
What do you mean by how i am interfacing with my 8051? i use a serial cable for me to interface it with LV. What i want is to have a feedback in my labview program coming from my 8051 board. That feedback will trigger the program to send another signal to my board, then so on and so forth.
01-07-2010 09:53 PM
Yup, i am currently using RS232 to interface my 8051 with labview, and i already have a MAX232 in my board. Just need to figure out how can i create a feedback from my board to labview. Then that feedback will trigger the said program to send another data or signal to my board. Thanks
01-07-2010 10:24 PM
01-07-2010 10:40 PM
01-07-2010 11:37 PM
That's for you to figure out in your communication scheme. You'll have to determine how you want the VISA writes and reads to occur so that you can piecemeal out the data.
VISA Write a piece of data.
VISA read until you get the desired response from the device.
VISA Write the next piece of data.
VISA read again until the response.
And so on, basically a big loop of Write, read and wait until the read is the desired response which may mean doing several VISA reads or even have to suffer through some VISA Read timeouts if it takes long enough for the other device to respond.
01-08-2010 12:11 AM
ok ok.. i'll try what you said. Please check the attached file. Here's the sample VI that i created for my 8051 board. Though this is not the actual program, this is only a part of my program responsible for serial interface. Would like to hear your comment and improvements regarding this program. Thanks a lot!
01-08-2010 12:30 AM
Configure the serial port before doing anything on it. In test 2, your DTR loop is in parallel to the Serial configure. You'll have a race has to which one occurs first. In test 3, your serial configure is happening after setting the DTR value. While neither situation may cause a problem, neither one seems like a good idea either.
In test 2 with your DTR loop, you are just signalling to your self. The Write and Read will happen quickly. The DTR loop will run forever until you hit stop, or you hit the DTR button. It will be made true and immediately be read as true which end the loop and thus the VI.
If the feedback you are talking about is hardware handshaking, you can definitely do that. Of course the handshaking protocol will also have to be implemented on the other device. You just have to make sure you are setting and reading the correct handshaking lines. And you have the correct cable between the PC and the device (often null modem if the other device's serial port is DTE like a PC, but it would be a straight through cable if it is DCE like an external modem). Read up on null modem cables and handshaking lines to figure out how to implement it.