Copying string in to a Datablock(Step7)

NoName

Member
Join Date
Sep 2003
Location
Domžale
Posts
273
Hi all.

I wan't to copy a string message(160 characters) in to a Datablock from wich a SMS message(also 160 characters) is sent.
I've tryed to do this through VB script in WinCC flex but I just can't find the right function to do so. Is it even possible.
Or does it have to be done through a funcion block in Step7?

Any info would be great.

Best regards...
Ales
 
I have tryed this with moving data in Step 7.
I used the move command.
The string in the datablock is 160 characters long. And starts at addres dbb36. I've tryed moving characters to this address an so on to dbb196.
I see the change in a variable table, but if I open the datablock and monitor it there is no change :S.

I'm clueless as to why this is happening. Any ideas people???

Regards...
Ales
 
You cannot monitor a string variable in a DB. Continue using your VAT table or use an array of chars with two bytes at the front for the string max length/actual length. (NB: The array of chars will be shown "down the screen" so you will struggle to read all 160 chars "easily").
 
Thanks for the info guys. I've tryed with the block move function, but nothing changed in the destination datablock. The destination datablock is an instance datablock. I guess that this is relevant, beacouse nothing seems to alter the initial value of the string in this instance datablock.

I've entered like so:
SRCblk input: P#DB101.dbx2.0 byte 160 <--- this means that the block will move 160 bytes from dbx2.0 onwards, right?

DSTblk output: P#db100.dbx38.9 byte 160.

Correct?
 
L D[AR2 said:
You cannot monitor a string variable in a DB. Continue using your VAT table or use an array of chars with two bytes at the front for the string max length/actual length. (NB: The array of chars will be shown "down the screen" so you will struggle to read all 160 chars "easily").

You cant see any changes online but you can see the latest string in the DB if you open the datablock online or switch from offline view to online view.
 
NoName said:
I've entered like so:
SRCblk input: P#DB101.dbx2.0 byte 160 <--- this means that the block will move 160 bytes from dbx2.0 onwards, right?

DSTblk output: P#db100.dbx38.9 byte 160.

Correct?

P#db100.dbx38.9 byte 160.
This is wrong there is no such thing as dbx38.9 it stops at 38.7. enter 38.0 or 39.0

Check the hex value you get from retval. If its zero everything is ok if its another value click the block and press F1 to get information about the error
 
Sory typo... I ment 38.0.
The return value is 0 when I exectue SFC20. So there is no error. But the value in the instance datablock DB100 does not change.
 
It should work.
How is tag set up in the original db and the instance DB?

Are you sure that you have data in the original DB.

It also possible that you overwrite the data from another place in the program.

If the tags are configured as String[160] you must add 2 bytes to the pointer P#DB101.dbx2.0 byte 162 or use symbolic addressing to move the complete string with the 2 starting length bytes.
 
If you dont have the correct length in the length bytes you cant see the string even if you open the datablock online then you must use a VAT just like L D[AR2,P#0.0] pointed out.

Another note the googles is not enough you must switch between offline/and online view to see string. Menu datablock/file and "open online".

You cant monitor constant changes to strings this way you will only see the string that is currently present in the datablock. To see the new string you have to make another toogle between offline/online
 
Last edited:

Similar Topics

I'm not super familiar with the Micrologix line of processors, but I am pretty familiar with RSLogix 500. I'm trying to simply copy a string to...
Replies
4
Views
302
Hi, I would like to hardcode a constant to s string so I can use various compare functions. I have found how to copy a string (ST) to another...
Replies
4
Views
15,118
Hi All, I am looking to copy and paste a routine. I know this has to be done offline. My question is, when I go back online, these tags are...
Replies
6
Views
553
Hello everyone, friends. I need help with something related to SCL. In a FB, I need to copy the value in the DB to the DB at another address. I...
Replies
3
Views
1,382
Hello all! Is it possible to COP a SINT array to a UDT structured the same as a SINT array, except all BOOL bits? I have a module that has an...
Replies
5
Views
3,169
Back
Top Bottom