hi, how to use MemFill Function?
sText:='HELLO'; mem.MemFill(ADR(stext),2,7);
Result is '$07$07LLO' , first 2 bytes change.
after that i try 0 instead of 7,
sText:='HELLO'; mem.MemFill(ADR(stext),2,0);
Result of sText is '', nothing left. Why?
Originally created by: Viacheslav Mezentsev
Try this.
program PLC_PRG var Β Β b: bool := true; Β Β sz: uint; Β Β sText: string := 'HELLO'; end_var if b then Β Β sz := len( sText ); Β Β Mem.MemFill( adr( stext ), sz, 16#31 ); // 0x31 = '1' Β Β b := false; Β Β end_if
sText is ASCIIZ string. So 0x00 is the mark of the end of string.
Log in to post a comment.
hi,
how to use MemFill Function?
Result is '$07$07LLO' , first 2 bytes change.
after that i try 0 instead of 7,
Result of sText is '', nothing left.
Why?
Originally created by: Viacheslav Mezentsev
Try this.
sText is ASCIIZ string. So 0x00 is the mark of the end of string.