VDF-GUIdance logo



  Visual DataFlex Logo
  

Shared knowledge leads to accumulated knowledge

        Printer Friendly Page


Serial Communications in VDF

by Andrew Kennard

Summary

I have an example written ages ago using win api calls.
In my own experience VDF and serial comms have never really gelled.
It's all my own hand coded stuff but your welcome to have a look if your interested
It was only really done to handle small amounts of data (200 chars at a time) but you could modify it to handle buffering.
Size: 8 KB Download
Date Created: 26/10/2002
Date Updated: 13/11/2002
Author: Andrew Kennard
Company: Words Bureau Systems


I've made this program up from one of my applications by cutting and pasting. So there are probably quite a few variables that are declared but never used etc so hope these don't throw you too much !

This self contained .src file 'should' just compile through the dfcompiler direct (ie just copy into an existing workspace)
The basic object structure of this simple example is :-
  • MainPanel - Basic Panel
    • SerialPortHandler - Array (non visual object to deal with serial port)
    • StartButton - Button to click to start a loop

The StartButton (at the end of the code) contains an OnClick procedure that sends "Hello from master" out of Com1 and sits and awaits "slave" to be read from the port.

To test:-
  • Compile and run on one PC
  • Connect Null modem/laplink type serial cable to com1
  • plug the other end into another pc and run hyperterminal
  • set hyperterminal to talk direct to COM1 9600,No parity,8 bits and make sure flow control is set to NONE
  • click the start button and "Hello from master" should appear on hyperterminal
  • on hyperterminal keyboard type "slave" (without the quotes)
  • as soon as you press the letter 'e', a showln box should appear saying: message received

This program source is provided as a 'thanks' to the DAW newsgroups and VDF-GUIDANCE for all it's help on various problems I have had. If you have any questions regarding this source you can email me
mailto:andrew@wordsbureau.co.uk and I will try and help. I'm not an expert in this field and have donated the code to help others as opposed to something I wish to "support" in a "big way"

Tests have shown that the program appears to be compatible -without source changes- with at least VDF6.2, VDF7.3 and VDF8.2

We advice you however to test carefuly if the code works on all the deployed platforms as it has been reported that this would not always work on the windows 2000 platform.
If anyone is capable of fixing this we would encourage them to send the results back to us.

Download



Serial.zip ~ 8Kb