LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Hot to create a feedback

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.

0 Kudos
Message 1 of 12
(3,723 Views)

Hi jmvrd,

  How are you interfacing the 8051 to labview?Whether you want a feedback in software or something else?

 

 

Thanks and regards,

srikrishanNF

Regards,
Srikrishna


0 Kudos
Message 2 of 12
(3,712 Views)

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

Message Edited by Coq Rouge on 01-05-2010 02:49 PM


Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 3 of 12
(3,696 Views)

@ srikrishnaNF: 

 

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. 

 

 

0 Kudos
Message 4 of 12
(3,651 Views)

@ Coq Rouge

 

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 

0 Kudos
Message 5 of 12
(3,650 Views)
If you are using a serial cable, then you need to program your LabVIEW program to use the serial port with NI-VISA functions to read the serial port and act on whatever data it reads back.
0 Kudos
Message 6 of 12
(3,642 Views)
I already have a VISA read imbedded on my program. However my problem is, i dont know how it can trigger my program to send another data. Currently, my program sends data all at the same time, what i need is to send data one by one.
0 Kudos
Message 7 of 12
(3,636 Views)

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.

0 Kudos
Message 8 of 12
(3,628 Views)

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!

 

 

Download All
0 Kudos
Message 9 of 12
(3,620 Views)

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.

0 Kudos
Message 10 of 12
(3,617 Views)