10-03-2007 03:36 PM
10-04-2007 04:44 AM
10-04-2007 10:50 AM
Norbert,
I am working with steve on this. Right now all of the UImessaging is done via LabVIEW and Teststand this works great. Now what we would like to do is use the ability of UI messages to communicate between LabVIEW and C++. The idea is to post and event in C++ and handle the event in LV. I have found a couple of examples and have shown them to Steve but they are not very clear on the way to do it properly in TS 4.0.
Could you post an example that uses TS 4.0 API to post a UImessage.
Thanks,
10-05-2007 02:30 AM
10-05-2007 07:46 AM
i am not sure if you can accomplish exactly what you like with UI Messages. UI Messages are designed to "tell the UI what to do" from a TestStand Sequence. You can, of course, post UI Messages from codemodules used in your sequence, but still, the UI Message is sent by TS and has to be caught by the UI....
Here is a excerp pseudocode which shows how you can post UI Messages in C(C#)-based codemodules:
int function(SequenceContext ThisContext)
{
Thread ThisThread = ThisContext.thread;
ThisThread.PostUIMessageEx(EventCode, numericDataParam, stringDataParam, activexDataParam, synchronous);
}
SequenceContext and Thread are object from the TS API of course....
hope this helps,
Norbert
The reason that we want to do this is so that when we are running long test the user has some indication that the program has not crashed. Can you point us to tutorials or to some examples that elaborate more on the details of what you said.
Thanks,
10-09-2007 07:23 AM
Norbert,
Sorry for the delay. If you're still out there perhaps you can answer another question. I understand the pseudocode however I am having trouble finding the function PostUIMessageEx. Can you (or someone) point me to a source file/DLL and/or proper includes?
Thanks,
Steve S.
10-10-2007 03:40 AM
10-10-2007 06:59 AM
Hi Wiebe,
Thanks for the input - I'll go over the PostLVUserEvent function with Joe - he's our LV expert. Maybe we can use that method.
As far as the UI messages go, they are a challenge to get working but we're already using them to communicate between a LV user interface and the TestStand sequences. I'd just like to be able to post an async UI message (string) from inside some of my longer-running DLLs to update the user interface. I'm pretty new to C++ and am having trouble finding the UI messaging functions in the teststand files.
Thanks,
Steve S.
10-10-2007 08:40 AM
10-10-2007 09:54 AM
The only problem with using the LVevent is that the dll is called by teststand and not by labview. LV is just used as the UI for teststand so getting a valid reference into teststand will be the tricky part.
Any suggestions,
thanks for the answers wiebe