In the Preinitialize code for the new keyboard page, the following statement occurs:
So it appears that p refers to a page id number, and b refers to a component (object) id number.
Is there a system variable which gives the number of pages in a project? Is there a per-page system variable which gives the number of objects in a page?
Is there a list of which component type number refers to which component name (e.g., type 98=button, type 116=text)?
Is there either documentation or more that I need to know about this syntax? Since except for fonts and images and code (and likely other things I don't know about) the basic constituents of a project are name / value pairs, I'm thinking about a routine which would output (with "print") a JSON file of the project.
the b[ ] component array was discovered by Steve (user indev2) with v0.38.
At that time (and still now), b[#] refers to the Component with .id #
This provided an array to access components and their attributes.
In v0.42, the b[.id].attribute Component array is used in the keyboards
- the new one not in v0.41 is the p[pagenum] Page Array
Now, neither of these arrays check if you have used them properly.
if you have a hotspot, text - there is no val attribute and you will have entered the fray into the unknown of what will occur when the runtime hits this invalid call. So users my be crafty when using the b[.id] array.
As for the new p[pageno] Page Array, there is even less it is capable of
- it doesn't make much sense when a non current page is not in memory
So much of the p[pageno] array is only useful for globals.
" there a system variable which gives the number of pages in a project?
No. But you have this number in Pages pane.
" Is there a per-page system variable which gives the number of objects in a page?
No. But you have this number - last item in Attribute pane's .id value
" Is there a list of which component type number refers to which component name (e.g., type 98=button, type 116=text)?
Many have built this personally, officially, No.
Many things have been stated already in forum discussions
But output to what ever format you wish, is upto the programmer that wants
I won't be working with JSON
90% of interaction between HMI and MCU side
You already know - you designed the HMI
So what is the syntax of
this is user code
- loadpageid.val is global variable to hold page value
- loadcmpid.val is global variable to hold component id
the type attribute is now visible in v0.42 but has always been
Type Attributes / Component y 0x79 121 Page t 0x74 116 Text 7 0x37 55 Scrolling 6 0x36 54 Number b 0x62 98 Button j 0x6A 106 Progress p 0x70 112 Picture q 0x71 113 Crop m 0x6D 109 Hotspot z 0x7A 122 Gauge 0x00 0 Waveform 0x01 1 Slider 3 0x33 51 Timer 4 0x34 52 Variable 5 0x35 53 DualState 8 0x38 56 Checkbox 9 0x39 57 Radio
Nothing special, just time to do
Thank you for that. It's a good start. Too bad the name attribute is not exposed.
"loadpageid.val is global variable"
Is there a list of system (non-user) global variables like loadpageid and loadcmpid?
I am sorry,
The objname is exposed in the editor and is user changeable.
loadpageid and loadcmpid are not system
they are variables declared in the HMI source page
This is merely a technique users can use to pass variables
- I believe this concept of passing variables was a tutorial
sometime in 2015 - available from users manual