User guide
63
VTB USER GUIDE
For example a FLASH memory has a maximum number of writing, block erase, etc.
IMS_WRITE
Writes in the internal FLASH at the address contained in ADDR, the data pointed by Punt for a total of NBYTE of data.
The FLASH memory is managed in BLOCKS of 256 bytes, for this it's recommended to write multiple of 256 bytes. That
because also writing less than 256 bytes the entire BLOCK is erased, therefore to avoid the loss of data it needs at
beginning to read all the block, save the interested data and overwrite again all the block. The systems NG35 or PEC70
have enough FLASH memory to be used without problems in blocks of 256 bytes also there is the need of less data.
Using the NGM13,NGMEVO,NGQ,NGQx, this function works on a FRAM memory which can be managed at single BYTE.
Hardware All
Syntax
IMS_WRITE(char *Punt, long Addr, long Nbyte) as char
Parameters
Punt Pointer to data buffer to be written
Addr Start address in the reserved area of the device
Nbyte Number of bytes to be written
Return value:
Char 0 No error
<>0 Writing error
Example
Used variables:
Vett(10) long
Ims_Write(Vett(),0,40) ‘ write 40 bytes (10 long * 4) to ADDR 0
WARNING: In this case the entire block of 256 byte is written if we are working with FLASH (NG35).
IMS_READ
Reads from the internal memory at address ADDR a number of byte as in NBYTE and writes them in the array pointed
by Punt.
Hardware All
Syntax
IMS_READ(char *Punt, long Addr, long Nbyte) as char
Parameters
Punt Pointer to data buffer where read data will be saved
Addr Start address in the reserved area of the device
Nbyte Number of bytes to be read
Return value:
Char 0 No error
<>0 Writing error
Example
Used variables:
Vett(10) long
Ims_Read(Vett(),0,40) ‘ read 40 bytes (10 Long) from Addr 0
11.7 ETHERNET FUNCTIONS
Systems equipped with ETHERNET manage AUTOMATICALLY the STACK TCP/IP. To work with protocols at upper level
than TCP/IP it must be written some source code in the application. For example to process the MODBUS-TCP protocol
there is a specific object in library which uses the functions of this group. In the same way it's possible to create










