18.01.2015 Views

Technical Reference Manual - InduSoft

Technical Reference Manual - InduSoft

Technical Reference Manual - InduSoft

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Appendix: Built-in Scripting Language<br />

Examples<br />

Tag Name<br />

Tag<br />

Tag<br />

Expression<br />

Swap16( 16 ) // 16 = 0000000000010000 in binary. Returned value = 4096 = 0001000000000000 in binary.<br />

Swap16( 43760 ) // 43760 = 1010010111110000 in binary. Returned value = 61610 = 1111000010100101 in binary.<br />

Swap32<br />

Swaps two words in a tag.<br />

Function Group Execution Windows Embedded Thin Client<br />

Swap32 Arithmetic Synchronous Supported Supported Supported<br />

Syntax<br />

Swap32( numValue )<br />

numValue<br />

Integer tag that holds the numeric value of the words to be swapped.<br />

Returned value<br />

Returns the numeric value after swapping the words.<br />

Examples<br />

Tag Name<br />

Expression<br />

Tag Swap32( 16 ) // 16 = 00000000000000000000000000010000 in binary. Returned value = 1048576 =<br />

00000000000100000000000000000000 in binary.<br />

Tag Swap32( 246333120 ) // 286333120 = 1010101010101010101111111100000000 in binary. Returned value =<br />

-1094709586= 11111111000000001010101010101010 in binary.<br />

Trunc<br />

Truncates the value of numValue.<br />

Function Group Execution Windows Embedded Thin Client<br />

Trunc Arithmetic Synchronous Supported Supported Supported<br />

Syntax<br />

Trunc( numValue )<br />

numValue<br />

Real tag to be truncated.<br />

Returned value<br />

Returns the integer portion of the real number value of numValue.<br />

Examples<br />

Tag Name<br />

Expression<br />

Trunc( 234.987 ) // Returned value = 234<br />

<strong>InduSoft</strong> Web Studio Page 543

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!