Previous Topic

Next Topic

Book Contents

Book Index

NV0Byte Directive [D>=15]

This applies only to SPLat/PC versions 6.15.1 or later, and is relevant only to SPLat controllers with language dialect 15 or later.

The NV0Byte directive causes SPLat/PC to create one or more data bytes in NVEM0 memory. The argument to NV0Byte consists of a comma-delimited list of bytes in any of the following formats

Example

Max value

Description

23

255

Decimal constant

'A3

255

Hex constant

%10101100

255

Binary constant

FooBar

255

A previously EQUated constant

T

255

Boolean True = %11111111

F

255

Boolean False = %0000000

"Hello"

 

A quoted text string

#WORD

65535

A 15 or 16 bit value preceded by #. New in SPLat/PC V7.16.4

Strings may be any printable characters, enclosed in quotes. A quotation mark is represented by two quotation marks in a row, viz ""

Any number of individual bytes, words and strings may be concatenated, with commas separating them. Spaces are not allowed except within quoted strings.

The #WORD form is supported in SPLat/PC V7.16.4 and later. It simplifies building of ModBus master scripts. It allows 16-bit values to be embedded in byte lists, but does have the limitation that values over 32767 expressed in anything other than decimal will be rejected. It is also not possible to include a 16-bit NVEM pointer value.

Examples:

WordConst  EQU	      51234                     ;A long decimal constant
MaxSpeed   EQU       100                       ;A byte constant
MyTable:   NV0Byte   45                        ;Decimal constant
           NV0Byte   'A9                       ;Hex constant
           NV0Byte   %10101100                 ;Binary constant
           NV0Byte   45,'A9,%10101100          ;All 3 of above combined
           NV0Byte   MaxSpeed                  ;Symbolic constant defined in an EQU
           NV0Byte   "The quick brown fox"     ;Simple text string
           NV0Byte   "Said ""I will bite you""" ;Quotes within a string
           NV0Byte   "Hello World",'0D,'0A     ;Mixed
           NV0Byte   MaxSpeed,#WordConst,"OK"  ;Mixed

Please refer to the NVEM0 documentation for more details and examples.

Previous Topic

Next Topic