# PC SDK - UIInstructionEventArgs BUGS

**URL:** <https://tech-community.robotics.abb.com/t/pc-sdk-uiinstructioneventargs-bugs/4121>\
**Category:** Developer Tools\
**Created:** [April 14, 2011, 10:07pm UTC](https://tech-community.robotics.abb.com/t/pc-sdk-uiinstructioneventargs-bugs/4121 "2011-04-14T22:07:34Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![kegley182](https://avatars.discourse-cdn.com/v4/letter/k/45deac/32.png) [@kegley182](https://tech-community.robotics.abb.com/u/kegley182)\
**Post date:** [April 14, 2011, 10:07pm UTC](https://tech-community.robotics.abb.com/t/pc-sdk-uiinstructioneventargs-bugs/4121/1 "2011-04-14T22:07:34Z")

</div>

**Dear ABB PC SDK developers** \*\*"Enable operator response to RAPID UI-instructions from a PC"\*\* There appears to be a bug in this PC SDK functionality. Robotware 5.13; PC SDK 5.13; MS Visual Studio 10, .NET 4.0; The problem is identical on Virtual controller as on Real controller.

upon recieving the UIInstructionEvent event, the event args do not propogate properly to the eventhandler… ie, when I evaluate the UIInstructionEventArgs “type” a and then cast to the appropriate subtype(..say UIMessageBoxEventArgs)  
…the arg properties " **.MsgArray"** (and others) are throwing errors!!!.

The conditions under which they throw errors relies upon the RAPID construct of the UI function from within the controller…  
For example with the rapid function “ **UIListView** ”..IF, I use 3 or less “list items” it works…  
CONST listitem list2{3} := [[“”,“Item1xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx”], [“”,“Item2xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx”],  
[“”,“Item3xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx”]];

BUT with more than 3 it does NOT work!!!  
CONST listitem list2{4} := [[“”,“Item1xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx”], [“”,“Item2xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx”],“], [”",“Item3xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx”],

[“”,“Item4xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx”]];

or with the rapid function **UIMessageBox**..  
IF, there are any commas the PC SDK UIMessageBoxEventArgs will throw errors… or if the text strings are too long(30 chars)… it’ll thow errors…

there are other cases, and I havent’ checked ALL situations, but all of these scenarios DO function properly on the FLEX PENDANT… just the PC SDK’s handling of the information is buggy!!

This PC SDK feature is/would be excellent for implementing a PC UI onto existing systems where exhaustive use of the Rapid UI functions are involved, and elimiates the need to restructure long standing robot code and processes…  
… UNFORTUNATELY it doesn’t work… CAN YOU PROVIDE fixes?.. will there be fixes in later versions? WHEN?.. I need this capability ASAP and have planned a project on it’s functioning.(didn’t plan on it not working)

Basically, the PC SDK UIInstructionEventArgs(and the classes that inherit it)  
need to handle EVERYTHING that the rapid functions can. … currently they don’t

Please let me know.

UIInstructionEventArgs UIListViewEventArgs UIAlphaEntryEventArgs UIMessageBoxEventArgs

---

<div class="post-metadata">

**Author:** ![Lennart\_H](https://avatars.discourse-cdn.com/v4/letter/l/ac91a4/32.png) [@Lennart\_H](https://tech-community.robotics.abb.com/u/Lennart_H)\
**Post date:** [April 15, 2011, 9:44am UTC](https://tech-community.robotics.abb.com/t/pc-sdk-uiinstructioneventargs-bugs/4121/2 "2011-04-15T09:44:15Z")

</div>

Mike,

Many thanks for information. An investigation is started. I will keep you updated.

---

<div class="post-metadata">

**Author:** ![Lennart\_H](https://avatars.discourse-cdn.com/v4/letter/l/ac91a4/32.png) [@Lennart\_H](https://tech-community.robotics.abb.com/u/Lennart_H)\
**Post date:** [April 19, 2011, 7:51am UTC](https://tech-community.robotics.abb.com/t/pc-sdk-uiinstructioneventargs-bugs/4121/3 "2011-04-19T07:51:25Z")

</div>

I have been able to reproduce the UIListView bug but not the UIMessageBox bug.

My test app does not throw an exception when:  
-A coma is included in the message array.  
-A string in the message array is longer than 30 chars.

Can you please submit some code that will help me to reproduce the bug?

Thanks!

---

<div class="post-metadata">

**Author:** ![kegley182](https://avatars.discourse-cdn.com/v4/letter/k/45deac/32.png) [@kegley182](https://tech-community.robotics.abb.com/u/kegley182)\
**Post date:** [April 20, 2011, 3:43am UTC](https://tech-community.robotics.abb.com/t/pc-sdk-uiinstructioneventargs-bugs/4121/4 "2011-04-20T03:43:34Z")

</div>

The “comma” prolem is simply that it introduces a linefeed into the text, instead of printing the comma.The “over 30 chars” problem, was mistated… it’s actually depends upon the number of array items in the message array… similiar to the uilistview, except that it starts failing after only takes 7 items… rapid manual states “55 characters, for upto 11 lines”…

**Below is a Rapid module** that demonstrates … the arrays are named accordingly to which ones work and which ones don’t.  
Additionaly I found that for some of them that DO work, occasionly they’d fail…

MODULE UIDebugMod  
CONST string DONTWORK10{10} := [“This is a 75 character long line this is a 75 character long line this 1”,  
“this is a 75 character long line this is a 75 character long line this 2”,  
“this is a 75 character long line this is a 75 character long line this 3”,  
“this is a 75 character long line this is a 75 character long line this 4”,  
“this is a 75 character long line this is a 75 character long line this 5”,  
“this is a 75 character long line this is a 75 character long line this 6”,  
“this is a 75 character long line this is a 75 character long line this 7”,  
“this is a 75 character long line this is a 75 character long line this 8”,  
“this is a 75 character long line this is a 75 character long line this 9”,  
“this is a 75 character long line this is a 75 character long line thi 10”];

CONST string DONTWORK55\_10{10} := [“This is a 55 character long line this is a 55 char 1”,  
“This is a 55 character long line this is a 55 char 2”,  
“This is a 55 character long line this is a 55 char 3”,  
“This is a 55 character long line this is a 55 char 4”,  
“This is a 55 character long line this is a 55 char 5”,  
“This is a 55 character long line this is a 55 char 6”,  
“This is a 55 character long line this is a 55 char 7”,  
“This is a 55 character long line this is a 55 char 8”,  
“This is a 55 character long line this is a 55 char 9”,  
“This is a 55 character long line this is a 55 char 10”];

CONST string DONTWORK55\_8{8} := [“This is a 55 character long line this is a 55 char 1”,  
“This is a 55 character long line this is a 55 char 2”,  
“This is a 55 character long line this is a 55 char 3”,  
“This is a 55 character long line this is a 55 char 4”,  
“This is a 55 character long line this is a 55 char 5”,  
“This is a 55 character long line this is a 55 char 6”,  
“This is a 55 character long line this is a 55 char 7”,  
“This is a 55 character long line this is a 55 char 8”];

CONST string DoesWORK55\_7{7} := [“This is a 55 character long line this is a 55 char 1”,  
“This is a 55 character long line this is a 55 char 2”,  
“This is a 55 character long line this is a 55 char 3”,  
“This is a 55 character long line this is a 55 char 4”,  
“This is a 55 character long line this is a 55 char 5”,  
“This is a 55 character long line this is a 55 char 6”,  
“This is a 55 character long line this is a 55 char 7”];

CONST string DoesWORK\_comma55\_7{7} := [“This is a 55 character long line, this is a 55 char 1”,  
“This is a 55 character long line, this is a 55 char 2”,  
“This is a 55 character long line, this is a 55 char 3”,  
“This is a 55 character long line, this is a 55 char 4”,  
“This is a 55 character long line, this is a 55 char 5”,  
“This is a 55 character long line, this is a 55 char 6”,  
“This is a 55 character long line, this is a 55 char 7”];

CONST string DONTWORK8{8} := [“This is a 75 character long line this is a 75 character long line this 1”,  
“this is a 75 character long line this is a 75 character long line this 2”,  
“this is a 75 character long line this is a 75 character long line this 3”,  
“this is a 75 character long line this is a 75 character long line this 4”,  
“this is a 75 character long line this is a 75 character long line this 5”,  
“this is a 75 character long line this is a 75 character long line this 6”,  
“this is a 75 character long line this is a 75 character long line this 7”,  
“this is a 75 character long line this is a 75 character long line this 8”];  
CONST string DoesWORK7{7} := [“This is a 75 character long line this is a 75 character long line this 1”,  
“this is a 75 character long line this is a 75 character long line this 2”,  
“this is a 75 character long line this is a 75 character long line this 3”,  
“this is a 75 character long line this is a 75 character long line this 4”,  
“this is a 75 character long line this is a 75 character long line this 5”,  
“this is a 75 character long line this is a 75 character long line this 6”,  
“this is a 75 character long line this is a 75 character long line this 7”];  
CONST string DoesWORK6{6} := [“This is a 75 character long line this is a 75 character long line this 1”,  
“this is a 75 character long line this is a 75 character long line this 2”,  
“this is a 75 character long line this is a 75 character long line this 3”,  
“this is a 75 character long line this is a 75 character long line this 4”,  
“this is a 75 character long line this is a 75 character long line this 5”,  
“this is a 75 character long line this is a 75 character long line this 6”];  
CONST string DoesWORK4{4} := [“This is a 75 character long line this is a 75 character long line this 1”,  
“this is a 75 character long line this is a 75 character long line this 2”,  
“this is a 75 character long line this is a 75 character long line this 3”,  
“this is a 75 character long line this is a 75 character long line this 4”];  
CONST string DoesWORK3{3} := [“This is a 75 character long line this is a 75 character long line this 1”,  
“this is a 75 character long line this is a 75 character long line this 2”,  
“this is a 75 character long line this is a 75 character long line this 3”];

CONST string DoesWORK2{2} := [“This is a 75 character long line this is a 75 character long line this 1”,  
“this is a 75 character long line this is a 75 character long line this 2”];

CONST string DoesWORK1{1} := [“This is a 75 character long line this is a 75 character long line this 1”];  
!-----------------------------------------------------  
!-----------------------------------------------------  
!-----------------------------------------------------  
PROC UIMessageBoxDebug()  
VAR btnres answer;  
testAnswer UIMessageBox(Header:="UIMessageBox Test"MsgArray:=DoesWORK1DefaultBtn:=resOKIcon:=iconInfo);  
testAnswer UIMessageBox(Header:="UIMessageBox Test"MsgArray:=DoesWORK2DefaultBtn:=resOKIcon:=iconInfo);  
testAnswer UIMessageBox(Header:="UIMessageBox Test"MsgArray:=DoesWORK3DefaultBtn:=resOKIcon:=iconInfo);  
testAnswer UIMessageBox(Header:="UIMessageBox Test"MsgArray:=DoesWORK4DefaultBtn:=resOKIcon:=iconInfo);  
testAnswer UIMessageBox(Header:="UIMessageBox Test"MsgArray:=DoesWORK6DefaultBtn:=resOKIcon:=iconInfo);  
testAnswer UIMessageBox(Header:="UIMessageBox Test"MsgArray:=DoesWORK55\_7DefaultBtn:=resOKIcon:=iconInfo);  
testAnswer UIMessageBox(Header:="UIMessageBox Test"MsgArray:=DoesWORK\_comma55\_7DefaultBtn:=resOKIcon:=iconInfo);  
testAnswer UIMessageBox(Header:="UIMessageBox Test"MsgArray:=DoesWORK\_comma55\_7Buttons:= btnAbrtRtryIgnDefaultBtn:=resOKIcon:=iconInfo);  
testAnswer UIMessageBox(Header:="UIMessageBox Test"MsgArray:=DoesWORK\_comma55\_7Buttons:= btnOKCancelDefaultBtn:=resOKIcon:=iconInfo);  
testAnswer UIMessageBox(Header:="UIMessageBox Test"MsgArray:=DoesWORK\_comma55\_7Buttons:= btnRetryCancelDefaultBtn:=resRetryIcon:=iconInfo);  
testAnswer UIMessageBox(Header:="UIMessageBox Test"MsgArray:=DoesWORK\_comma55\_7Buttons:= btnYesNoDefaultBtn:=resYesIcon:=iconInfo);  
testAnswer UIMessageBox(Header:="UIMessageBox Test"MsgArray:=DoesWORK\_comma55\_7Buttons:= btnYesNoCancelDefaultBtn:=resYesIcon:=iconInfo);  
testAnswer UIMessageBox(Header:="UIMessageBox Test"MsgArray:=DONTWORK55\_10DefaultBtn:=resOKIcon:=iconInfo);  
testAnswer UIMessageBox(Header:="UIMessageBox Test"MsgArray:=DONTWORK55\_8DefaultBtn:=resOKIcon:=iconInfo);  
ENDPROC

proc testAnswer(btnres theanswer)  
tpwrite "The Answer Number was == " Num:=theanswer;  
endproc

ENDMODULE

---

<div class="post-metadata">

**Author:** ![sehe](https://avatars.discourse-cdn.com/v4/letter/s/a88e57/32.png) [@sehe](https://tech-community.robotics.abb.com/u/sehe)\
**Post date:** [May 16, 2011, 3:42pm UTC](https://tech-community.robotics.abb.com/t/pc-sdk-uiinstructioneventargs-bugs/4121/5 "2011-05-16T15:42:56Z")

</div>

I am running into these same problems as well. Has there been any resolution to this?

I have a project deadline in the next few weeks and this is very important to that deadline.

Thanks for the help.

---

<div class="post-metadata">

**Author:** ![sehe](https://avatars.discourse-cdn.com/v4/letter/s/a88e57/32.png) [@sehe](https://tech-community.robotics.abb.com/u/sehe)\
**Post date:** [May 16, 2011, 3:52pm UTC](https://tech-community.robotics.abb.com/t/pc-sdk-uiinstructioneventargs-bugs/4121/6 "2011-05-16T15:52:09Z")

</div>

I forgot to mention some other problems that I am seeing with the UI Instructions.

On the **UINumEntry** and **UINumTune** messages if the user doesn’t put in a min or max value, it always comes through as a 0. That makes it impossible for me to check if the result is valid before I send it back to the robot.

Also with **UINumEntry** and **UINumTune** , the as integer boolean always comes through as false.

Here is an example of a **UIMessage** box with a comma in it as well as the event args in VS.

Robot:  
MessageAnswer:=UIMessageBox (Header:="Header"Message:="Single, Message [2]"Buttons:=btnOKCancelIcon:=iconInfo);

VS Event Args:  
MsgArray  
[0] = “Single”  
[1] = “Message 2”  
[2] = “Message 2”

I hope that helps.

---

<div class="post-metadata">

**Author:** ![Lennart\_H](https://avatars.discourse-cdn.com/v4/letter/l/ac91a4/32.png) [@Lennart\_H](https://tech-community.robotics.abb.com/u/Lennart_H)\
**Post date:** [May 23, 2011, 12:28pm UTC](https://tech-community.robotics.abb.com/t/pc-sdk-uiinstructioneventargs-bugs/4121/7 "2011-05-23T12:28:57Z")

</div>

Hopefully are these bugs fixed in 5.14.01, planned to be released 2011-06-17. Please note that we do not guarantee this, priorities might change…

---

<div class="post-metadata">

**Author:** ![Lennart\_H](https://avatars.discourse-cdn.com/v4/letter/l/ac91a4/32.png) [@Lennart\_H](https://tech-community.robotics.abb.com/u/Lennart_H)\
**Post date:** [June 29, 2011, 9:13am UTC](https://tech-community.robotics.abb.com/t/pc-sdk-uiinstructioneventargs-bugs/4121/8 "2011-06-29T09:13:49Z")

</div>

Two problems are fixed in PC-SDK 5.14.01.

-UIInstruction supports now more than 4 lines of text.  
-Comma in UIMessageBox text is not interpreted as newline.
