<< Click to Display Table of Contents >> Navigation: 3. Script Language > Variable Definitions and Operations > Inline Data Commands > Variable Commands |
MiniRobotLanguage (MRL)
VDA. Inline Data Start
VDE. Inline Data End
Variables with Inline Data
Intention
This command can be used to include Binary Data into your Script.
It is very useful to also include pictures or other data directly in the Script.
There are 4 Options to use this commands.
1. Just write your Data in dezimal numbers separated by ",".
This way you can manually enter data.
VDA.$$DTA|$$FIN=
64,65,255,0,21
VDE.
For all 3 further Options you will need to use the Datamaker.exe - Utility, which is in your SPR-Package included.
You can simply drag and drop files on to the Datamaker-Tool, to have them converted into Inline-Code.
There is a dedicated chapter about how to use the Datamaker-Tool.
The important Point is that the VDA.-Commands supports 4 Data-Types and additionally 2 Options.
You can simply set them in the Datamaker-Tool, the rest is done automatically.
Supported Data-Formats:
General comments:
As you can see, Dezimal Data starts with the Sequence "`?D". Then there is a 0,1 which means the Data is compressed but not encrypted. All this is done automatically if you use the Datamaker-Tool. The Data that has been created using the Datamaker-Tool also includes the Original Filename of the File - which will be in $$FIN - and a checksum to make sure that your data was not changed.
The chacksum is automatically calculated when the data is extracted. If the Data was changed, the VDA. will not extract the data and set the Timeout Flag..
1. Manually entered Dezimal Data: These are dezimal numbers between 0 and 255 separated by a ",".
This way you can manually enter data. $$FIN will be empty because this data can never contain a filename.
VDA.$$DTA|$$FIN=
64,65,255,0,21
VDE.
2. Dezimal Data: These are dezimal numbers between 0 and 255 separated by a ",". Each number represents 1 Byte of Data.
As you can see, Dezimal Data starts with the Sequence "`?D".
Looks like this:
' $$DTA = Data
' $$FIN = Filename of Sourcefile
' Length: 386 Bytes in 7 Lines.
VDA.$$DTA|$$FIN=
?D0,1,110,0,0,0,74,81,236,212,59,216,196,99,142,123,50,231,210,17,63,
92,23,69,204,17,252,33,210,155,44,235,50,194,135,6,208,22,59,220,
54,112,63,212,166,150,66,0,107,254,33,79,44,112,112,48,228,80,57,
66,0,107,123,27,22,136,95,124,168,167,215,151,155,168,210,137,135,
92,42,62,194,173,226,6,148,10,42,36,169,15,60,40,235,88,44,96,229,
181,175,53,99,103,6,66,152,10,13,86,58,70,1
VDE.
3. Headezimal data. These are Hexadezimal numbers, where each uses 2 Digits therefore there is no Separation between them.
Hexadezimal Data starts with the Sequence "`?H".
' F:\00_MR\PB_MiniRobots-Editoren\SPRE 02\Source\Sample Scripts\Tests\File.txt
' $$DTA = Data
' $$FIN = Filename of Sourcefile
' Length: 232 Bytes in 5 Lines.
VDA.$$DTA|$$FIN=
?H00016E0000004A51ECD43BD8C4638E7B32E7D2113F5C1745CC11FC21D29B2CEB32
C28706D0163BDC36703FD4A69642006BFE214F2C707030E4503942006B7B1B1688
5F7CA8A7D7979BA8D289875C2A3EC2ADE206940A2A24A90F3C28EB582C60E5B5AF
3563670642980A0D563A4601
VDE.
4. Text-Coded data.
This Format starts with "?M". This Format uses least Space because it uses all Textual Charactes to store the Information.
Please prefer this datatype for larger Data-Amounts, as it unpacks very efficiently and uses least space.
' F:\00_MR\PB_MiniRobots-Editoren\SPRE 02\Source\Sample Scripts\Tests\File.txt
' $$DTA = Data
' $$FIN = Filename of Sourcefile
' Length: 154 Bytes in 3 Lines.
VDA.$$DTA|$$FIN=
?MAAFuAAAASlHs1DvYxGOOezLn0hE/XBdFzBH8IdKbLOsywocG0BY73DZwP9SmlkIA
a/4hTyxwcDDkUDlCAGt7GxaIX3yop9eXm6jSiYdcKj7CreIGlAoqJKkPPCjrWCxg
5bWvNWNnBkKYCg1WOkYB
VDE.
If Data that was created using the Datamaker-Tool was changed and therefore the included checksum does not match, you will get in $$DTA the Text "VDA. can not retrieve Data.".
' Sample that leads to the Error Message "VDA. can not retrieve Data."
' This data is invalid therefore it will not be extracted.
GSB.Laa
MBX.$$DTA
ENR.
'-----------------------------------------------------------
:Laa
' F:\00_MR\PB_MiniRobots-Editoren\SPRE 02\Source\Sample Scripts\Tests\File.txt
' $$DTA = Data
' $$FIN = Filename of Sourcefile
' Length: 154 Bytes in 3 Lines.
VDA.$$DTA|$$FIN=
?MAAFuAAAASlHs1DvYxGOOezLn0hEdw/XBdFzBH8IdKbLOsywocG0BY73DZwP9SmlkIA
a/4hTyxwcDDkUDlCAGt7GxaIX3yop9eXm6jSiYdcKj7CreIGlAoqJKkPPCjrWCxg
5bWvNWNnBkKYCg1WOkYB
VDE.
RET.
Syntax
VDA.P1|P2=
<Data>
VDE.
Parameter Explanation
P1 - Variable. This Variable will be filled with the Binary Data.
P2 - Variable. This Variable will be filled with the Original Filename or a "-" Sign if there is no filename. It may also be empty for manual entered data.
Speed in Ticks:
The speed of the decoding from the Inlined Data heavily depends on the used Format. For our speed-Test we used Lines with 64 Characters. As you may have seen, the line-lenght can be adjusted in the Data-Maker-Tool.
For 2695 Lines of Hexadezimal Data the robot needed 524.000 Ticks to extract the data , that is roughly 194 Ticks per line of Hexadezimal Data. For the same data compressed an in textual format, the robot needed just 6725 Ticks.
Therefore Textual Data is the preferred way to include large sets of Data. Its more efficient in terms of Space and its optimized for Speed. In Decimal coding, we get 4765 Lines that equal about 325kb of Data is extracted from Decimal coding in 496219 Ticks, that is a 1/32 th of a second which equals 100 Ticks per line.
Therefore if using Textual Data within the 32-bit Data-Range, the Robot should extract the data generally below 1 Second in Real-Time.
Example
Sample-Script using VDA. and VDE. to store and display a small picture.
GSB.Laa
ANA.#FromVar|1|$$DTA
ANA.Show|1#!
ENR.
'===========================================================
:Laa
'-----------------------------------------------------------
' BITMAP from Clipboard(.bmp).
' $$DTA = Data
' $$FIN = Filename of Sourcefile
' Length: 1392 Bytes in 22 Lines.
VDA.$$DTA|$$FIN=
?MAAGuBQAASlG0yTbYYlYMQvkOznPrYa3D1MGg62CLOJf5wNvQQ99VP4L6gQQ5AQXC
OpZoDz0mKBeeLz0riH9lGqZQA79lN4b4AtrGQBuz43T5ifxZuUGlkhKiUgJlmuYw
k3eBRZ9a0WwN+wjqxthPIlWS4rJSTa7stW/t3kQBBcK6Vgi/hQq+XAXCutbI35Vy
cnr2e4dGgPuje8jH5vNDpNH9JmQJeUncSSENg3+Fx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7vn9jiX+UAb8LMHyWEtk/fB5W+yHbbQy2DCPBVG
OwE=
VDE.
RET.
Remarks
-
Limitations:
Binary, octal and hexadezimal numbers can not be negative and they can not be floating point numbers.
See also:
• Inline-Data and Inline-Pictures