plc:plc_show_custom_message_box:old_version
no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
— | plc:plc_show_custom_message_box:old_version [2019/05/17 09:54] (current) – created ivan | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | =====Showing a custom message box in older software===== | ||
+ | In [[plc: | ||
+ | |||
+ | Global variables 9100-9163 are reserved to show/hide enumerated Popup message box. | ||
+ | Writing " | ||
+ | |||
+ | Content for message box #0...#63 defined in cnc-variables.xml configuraton file by item **cnc-popup-message-0** ... **cnc-popup-message-15** | ||
+ | |||
+ | <code xml> | ||
+ | <value name=" | ||
+ | header=" | ||
+ | headerHeight=" | ||
+ | fontSize=" | ||
+ | timeout=" | ||
+ | </ | ||
+ | |||
+ | Message box contains 3 lines. Lines defined by attributes **header** (top line), **message** (middle line), **footer** (bottom line). Font size for each line defines by attributes **headerFontSize**, | ||
+ | |||
+ | Line height for each line defined by attributes **headerHeight**, | ||
+ | |||
+ | Attributes **width** and **height** define message box width and height in pixels. | ||
+ | Popup Messagebox will be automatically hidden if variable value was not changed longer than time defined in **timeout** attribute. | ||
+ | |||
+ | Parameter value can be printed in Message Box. To print a value - | ||
+ | * Message attribute should contain C-style contains format line (ie " | ||
+ | * Attribute **dest** should define variable number | ||
+ | * Attribute **K** defines scale ratio. | ||
+ | |||
+ | For example if | ||
+ | * message=" | ||
+ | * dest=" | ||
+ | * K=" | ||
+ | |||
+ | Variable #99 value multiplied by K-ratio will be printed: if variable value is 95000, value **95** will be shown. | ||
+ | |||
+ | {{plc: | ||
+ | |||
+ | Source code to show Message Popup is | ||
+ | <code c> | ||
+ | gvarset(9100, | ||
+ | portset(OUTPUT_OXY_HEAT_HI); | ||
+ | timer=time_preheat; | ||
+ | break_heating=1; | ||
+ | //if the value will be clearen outside of PLC, abort Preheat procedure | ||
+ | do { | ||
+ | timer--; | ||
+ | if (portget(6)!=0) // | ||
+ | { | ||
+ | timer=0; | ||
+ | }; | ||
+ | if (break_heating==0) | ||
+ | { | ||
+ | timer=0; | ||
+ | }; | ||
+ | if ((timer& | ||
+ | { | ||
+ | gvarset(99, | ||
+ | }; | ||
+ | | ||
+ | |||
+ | gvarset(9100, | ||
+ | </ |
plc/plc_show_custom_message_box/old_version.txt · Last modified: 2019/05/17 09:54 by ivan