uptown47
Lifetime Supporting Member
I've done a search on this forums (and Siemens forums) trying to get my head around UDT's and strings.
I found an example by Daniel Chartier from a long while ago detailing a way of explaining UDT's by imagining a record collection:
I started to create this as an example to help myself understand UDTs and also strings but I can't find any way of 'MOVE'ing a value into a string.
The accumulators etc only hold 4 characters but even....
... doesn't work.
I know that you can MOVE a string from one place to another with BLKMOVE but not sure how you initially put a value into it (or maybe you can't???)
I've read how other people prefer to use CHARs etc...
This isn't for a real program, just me trying to understand more about the darker depths of S7.
I've posted similar questions before and found some of my old questions as I searched. I found an example posted by LD utilising an ARRAY of UDTs etc but it was a bit above my head.
I basically would like to see how you could do a very very (very) simple example of a UDT utilising a couple of data types including a STRING. Just to see how it would be used in a very simple program.
Anyone got anything like that? Or any reading material they could link me to??
Berger only seems to give a brief overview and other forms of reference are either too complicated or only reference RS Logix.
Many thanks for any help
;-)
I found an example by Daniel Chartier from a long while ago detailing a way of explaining UDT's by imagining a record collection:
Code:
ALBUM_1: ALBUM{
[COLOR=black]Record number (INT): 1[/COLOR]
[COLOR=black]Title (String[30]): White Album[/COLOR]
[COLOR=black]Artist {STRING[20]): The Beatles[/COLOR]
[COLOR=black]Genre (STRING[15]): Classic Rock[/COLOR]
[COLOR=black]Date of publication (DATE): July 1968[/COLOR]
[COLOR=black]...[/COLOR]
[COLOR=black]}[/COLOR]
I started to create this as an example to help myself understand UDTs and also strings but I can't find any way of 'MOVE'ing a value into a string.
The accumulators etc only hold 4 characters but even....
Code:
L 'ABBA'
T CDs.Artist // This is a field in my UDT
... doesn't work.
I know that you can MOVE a string from one place to another with BLKMOVE but not sure how you initially put a value into it (or maybe you can't???)
I've read how other people prefer to use CHARs etc...
This isn't for a real program, just me trying to understand more about the darker depths of S7.
I've posted similar questions before and found some of my old questions as I searched. I found an example posted by LD utilising an ARRAY of UDTs etc but it was a bit above my head.
I basically would like to see how you could do a very very (very) simple example of a UDT utilising a couple of data types including a STRING. Just to see how it would be used in a very simple program.
Anyone got anything like that? Or any reading material they could link me to??
Berger only seems to give a brief overview and other forms of reference are either too complicated or only reference RS Logix.
Many thanks for any help
;-)