NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

UI Message Help - Send Array to the UI via ActiveX

Solved!
Go to solution

Hello,

I have asked a similar questoin before but now I'm having issues trying to get a array to the UI via UI messaging. I'm my TestStand code I have an expression to send a array that is located as a FileGlobal array container to the UI as such:

 

RunState.Thread.PostUIMessageEx(UIMsg_UserMessageBase + 2,0, "", FileGlobals.DataRead, False)

 

and in the UImessage callback I have what I thought I should do to send the data to a text table on the UI. This is not working.

 

Can someone tell me what I'm doing incorrectly?

Attached is the UIcallback, Control and a picture of the table on my UI

 

 

Bill Lewis
0 Kudos
Message 1 of 14
(7,087 Views)

 

You can't directly pass the data in a UIMessage.  You can, however, pass a reference to ThisContext.  Then, you can modify your UI Message Handler to query for that value, directly using TestStand - Get Property Value.

 

 

0 Kudos
Message 2 of 14
(7,057 Views)

@JGruenberg wrote:

 

You can't directly pass the data in a UIMessage.  You can, however, pass a reference to ThisContext.  Then, you can modify your UI Message Handler to query for that value, directly using TestStand - Get Property Value.

 

 


Like this?

Bill Lewis
0 Kudos
Message 3 of 14
(7,053 Views)

Yes, but you can use the TestStand - Get Property Value.vi directly with the TS.SequenceContext reference and avoid casting variants into other things.  

0 Kudos
Message 4 of 14
(7,046 Views)

@JGruenberg wrote:

Yes, but you can use the TestStand - Get Property Value.vi directly with the TS.SequenceContext reference and avoid casting variants into other things.  


Thanks for the help JGruenberg.

I have tried and it seems that the TS.SequecneContext is not correct or I'm not doing something correct. Attached is what i changed. Any other suggestions?

Bill Lewis
Download All
0 Kudos
Message 5 of 14
(7,028 Views)
What exactly is happening? Is that callback executing? Is there an error?
0 Kudos
Message 6 of 14
(7,020 Views)

Here is the error the callback is giving during the UI 10001 message


@JGruenberg wrote:
What exactly is happening? Is that callback executing? Is there an error?



 

Bill Lewis
0 Kudos
Message 7 of 14
(7,015 Views)

Your SequenceContext control is not connected to anything, so its not going to have a real value.  You need to get your sequence context from the UIMessage object's ActiveX member.  This is how you'd do that:

 

UIMessage.png

Message 8 of 14
(7,008 Views)

I'm close! Smiley Very Happy

 

I get a LabView error stating that a null value or deleted value was passed to the UImessage so I'm assuming this is because of my UI message format. Do i need to put the runstate.thiscontext? there or is this correct?

 

UI Message code to 10001 and 10002:

 

RunState.Thread.PostUIMessageEx(UIMsg_UserMessageBase + 1,0, "", Nothing, False),
RunState.Thread.PostUIMessageEx(UIMsg_UserMessageBase + 2,0, "", Nothing, False)

 

the step before the UI message is a multinumeric test and in the post expression I'm writing the data to the fileglobals with

FileGlobals.DataRead == Step.NumericArray

Bill Lewis
0 Kudos
Message 9 of 14
(6,998 Views)

RunState.Thread.PostUIMessageEx(UIMsg_UserMessageBase + 1,0, "", Nothing, False),
RunState.Thread.PostUIMessageEx(UIMsg_UserMessageBase + 2,0, "", Nothing, False)

 

"Nothing" in there should be replaced with ThisContext.  You might want to change it to be synchroneous (changing the last parameter to True).

0 Kudos
Message 10 of 14
(6,995 Views)