Crimson 3.0 Programming Software - working with a common nested popup

Yna

Member
Join Date
Jul 2012
Location
Metro Manila
Posts
37
Hi everyone! I'm working with crimson OIT Graphics. I create a common nested popup (yes/no confirmation) for several units. I write a script on the Program but its no working correctly.

This is the script:

//DISPLAY CONFIRMATION//
if(tag1==2)
{
Sys_PopLine1="Reset Blower 01";
Sys_PopLine2="Running Hours?";
ShowNested(PopupYesNo);
}

//CONFIRM ACTION//
if(tag1==1)
{
Set(Blower1_Reset_Cmd,1);
Sleep(500);
Set(Blower1_Reset_Cmd,0);
Sleep(500);
}

Note:
1.On the detailed page, I add an action On Pressed: Tag1=2 and call the Program On Released: Program1().

2. On the confirmation, I add an action on the yes button:Tag1=1.

3.Blower1_Reset_Cmd is a flag IO tag (Read & Write). Tag1 is an Internal Tag(numeric).

Item 1 is working, it displays the popup correct if tag=2. But, item 2 is not working. Even tag=1, it does not set the blower1_reset_cmd to 1.

Can anyone help me? This is my first project in crimson software. Thanks in advance.
 
Hi everyone! I'm working with crimson OIT Graphics. I create a common nested popup (yes/no confirmation) for several units. I write a script on the Program but its no working correctly.

This is the script:

//DISPLAY CONFIRMATION//
if(tag1==2)
{
Sys_PopLine1="Reset Blower 01";
Sys_PopLine2="Running Hours?";
ShowNested(PopupYesNo);
}

//CONFIRM ACTION//
if(tag1==1)
{
Set(Blower1_Reset_Cmd,1);
Sleep(500);
Set(Blower1_Reset_Cmd,0);
Sleep(500);
}

Note:
1.On the detailed page, I add an action On Pressed: Tag1=2 and call the Program On Released: Program1().

2. On the confirmation, I add an action on the yes button:Tag1=1.

3.Blower1_Reset_Cmd is a flag IO tag (Read & Write). Tag1 is an Internal Tag(numeric).

Item 1 is working, it displays the popup correct if tag=2. But, item 2 is not working. Even tag=1, it does not set the blower1_reset_cmd to 1.

Can anyone help me? This is my first project in crimson software. Thanks in advance.



For a confirmation dialog, you might try the Showmodal() EndModal() commands. I often use this for a Yes/No Dialog. My suspicion is that the program calls the popup, but does not wait for a response. and continues looking at tag1 before a decision can be made.

Your code would then look like this.

int Ans;
if(tag1==2)
{
Sys_PopLine1="Reset Blower 01";
Sys_PopLine2="Running Hours?";
Ans = ShowModal(PopupYesNo);
}

//CONFIRM ACTION//
if(ans)
{
Set(Blower1_Reset_Cmd,1);
Sleep(500);
Set(Blower1_Reset_Cmd,0);
Sleep(500);
}

For you Buttons you would use
Endmodal(1) for Yes button
Endmodal(0) for No button
 
Thanks you so much Brian!. The Showmodal() Endmodal() is working.

Thank you also Jeremy, brian's suggestion is working. Your support is very much appreciated.

Regards,
 

Similar Topics

Hey everyone! Need a little help with some scripting in Crimson 3.0. With this first script I am just trying set a local variable string based...
Replies
8
Views
2,371
I am stuck, pretty new at c "like" programming. Trying to have a program run some comparisons to setpoints and variable data that comes in from a...
Replies
27
Views
5,593
Hi, I have a Red Lion E3 io counting output from weld cells, connected to a PTV station for the visuals. Our number of weld cells is set to...
Replies
2
Views
1,567
Good day I'm looking for a way to let crimson 3 monitor 3 temperatures from modbus then i want crimson to "GotoPage" when these 3 temps have...
Replies
3
Views
1,647
Hello all, First time here, So I want to take an analog input and total it over time. For example, the input would be in ml/s and I would like...
Replies
1
Views
1,490
Back
Top Bottom