Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
08/07/04 01:04
Read: times


 
#75585 - RS232 - VB&51 data transfer
Responding to: ???'s previous message
Hi Stanley,

I am also currently working on such a project wherein the MCU in a standalone equipment sends data over the serial link and the PC running a VB program captures and plots the two channels that have a span of +/-10V dc.

What I am doing is similiar to what Russell had explained :

1. the MCU waits for a specific character from the PC.

2. Once it is recieved, the MCU initiates a set of local actions and also starts reading a AD574.

3. Channel_1 is the command (+/-10V) from the MCU and Channel_2 is the feedback (+/-10V) from a field equipment .

4. The MCU digitises both channels and sends the "datapacket" in following format : XXXXYYYY<space>XXXXYYYY. X=Channel_1 data and Y=Channel_2 data.

5. At the PC end I read the packets into a large array and using a buffering mechanism plot the values either both against time or one channel vs other channel.

In your case you can follow the above with following changes :

1. Allocate a single unique code for each channel.

2. The VB sends to MCU the code of two channels that it wants.

3. Decipher the code at MCU end and based on that, select the ADC channels and then transmit the datapacket as above.

For your information there is no defined protocol for the above job. I simply use 9600 / 8-N-1 with no handshake and the results have been fine.

Please note that my equipment operates "safely" in a test lab with practically no offending items like motors or welding sets. If your environment is different, watch out for data corruption and bring in protection for such.

Raghu

List of 15 messages in thread
TopicAuthorDate
RS232 - PC&51 communication            01/01/70 00:00      
   RE: RS232 - PC&51 communication            01/01/70 00:00      
      Not modem            01/01/70 00:00      
   RE: RS232 - PC&51 communication            01/01/70 00:00      
      Using VB6.0 OnComm            01/01/70 00:00      
         RE: Using VB6.0 OnComm            01/01/70 00:00      
      RE: RS232 - PC&51 communication            01/01/70 00:00      
   RE: RS232 - PC&51 communication            01/01/70 00:00      
      RE: RS232 - PC&51 communication            01/01/70 00:00      
         RE: RS232 - PC&51 communication            01/01/70 00:00      
         RE: RS232 - PC&51 communication            01/01/70 00:00      
   RE: RS232 - PC&51 communication            01/01/70 00:00      
      RE: RS232 - PC&51 communication            01/01/70 00:00      
    RS232 - VB&51 data transfer            01/01/70 00:00      
   RE: RS232 - PC&51 communication            01/01/70 00:00      

Back to Subject List