10-31-2012 10:36 AM
Hello. I'm brand new to TS and am trying to setup is a DLL call which sends a message out a port (the DLL returns true/false that the message was sent), then when the device on the bus responds to the message the DLL captures it and sends it to the application that called the DLL. Teststand in this example.
I did get the DLL call to work. I can see the message going out the port. I do get a response from the device I'm talking to but don't know how TS captures it.
My idea was to make the call then let TS sit in a loop for some time while the device is responding and exit with a timeout if it doesn't.
Thanks!
11-01-2012 07:42 PM
I just want to make sure I understand what you're looking for here. You're developing a .dll in another environment and want to integrate it into the TestStand environment, correct?
If you're able to work with the .dll correctly in the TestStand environment, you can likely obtain a waiting process using the Flow control and synchronization options in your steps. Have you explored any of those in order to implement the waiting structure you're looking for? If so, what are you being limited by in those sections?
11-02-2012 08:17 AM
Thank you for your response! I am not the DLL developer. I think what I am attempting to do may be common when using a DLL but I'm probobly not explaining it correctly because I don't know what the mechanism is called in the C++ language of which I am a beginner. ![]()
The C++ program that uses this DLL first makes a call to the DLL passing it parameters for a device address and data address. The DLL then responds with Pass or Fail to indicate that the message was sent out on the communications bus. If the device on the bus responds then the DLL will send a message with the response back to the C++ program (the C++ program has an "dllimport" varable so the DLL has a way to receive the data). The C++ program has an event handler to capture a notification message from the DLL saying the data has been sent to the C++ programs memory (the dllimport variable). This is like a mouse click event handler but I don't know what it's proper name is. See the following C++ code that captures the notification message.
This is in the message map of a C++ file
ON_REGISTERED_MESSAGE(MsgReadPropAckID, MSG_Receive)
afx_msg LONG MSG_Receive(WPARAM ch,LPARAM port); //Receive message function
What I am trying to figure out is how do I set up TestStand to do this? Or maybe it doesn't support this? Thanks! 🙂
And in the meantime I've come up with another DLL type question. 🙂 I need to pass the TS programs handle as one of the DLL parameters but I don't know how to reference it. Any additional help would be great but I should probably post this seperately.
11-05-2012
07:28 PM
- last edited on
10-18-2024
07:36 PM
by
Content Cleaner
Hi Pat,
As Tim said, you'll want to try the various synchronization steps that are available in TestStand. You can find more information for these steps from the Help Files. You can call the DLL from an Action step with the appropriate adapter.
Cheers,