Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is there a DDE event

Status
Not open for further replies.

robertkeenan

Technical User
Feb 16, 2005
2
GB
I work with PLC's and have a machine connected to a PC for recording data. To read the data from the PLC I use software called KEPDirect (KEPDirect for PLCs is a 32-bit windows application that provides a means of bringing data and information from a wide range of industrial devices and systems into client applications on your windows PC.)My PC runs Win XP with SP2 and has Access 2003 on it. When I open the main form a connection is made to KEPDirect as follows

Channel_C = DDEInitiate("kepdirectdde", "Test_C")

Using a form timer I check every 3s to see if the machine has finished its test and save the data.

finished = DDERequest(Channel_C, "StartTransfer")

My problem is that the data can be avaiable at any time and while the 3s timer is running the PC becomes rather dead, and there is no chance of working with Access to view previous results. Is there any way of seeing the change in the value of "StartTransfer" and using this to initiate the event to save the data.
 
You can make your timer event longer than 3 seconds (say 10 or 30). If this dde function normally takes 60 seconds, don't check at all for 60 seconds, then check every 10 seconds for a minute, then every 3 seconds after that.

How 'timely' does the data have to be?

Greg
"Personally, I am always ready to learn, although I do not always like being taught." - Winston Churchill
 
The problem with increasing the time is that at the other end the machine might have to wait longer. This is a test rig I have built for testing water pumps and the timing of the data depends on the throughput of the operator. At the end of each test the machine has a touch screen which brings up an option to fill in the QA number. Once he has filled this in the PLC flags the PC that data is available. For the operator he will sometimes see a slight delay before his screen will move on to let him start another test. This at the moment is no longer than 3s and usually shorter. If I increase the time then if the test finishes at the start of the timer, the delay would seem too long. I could put the PLC data into a different set of registers and let the next test start but I feel more comfortable knowing that the data has been saved before starting another test. This is where I would like Access to decided when to save and not have the PC locking up every 3s.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top