uptown47
Lifetime Supporting Member
Ahhahh... So I create a new FB and then use FB 1 as a multi-instance within that and pass the UDTs to each instance...
;-)
Thanks LD ;-)
;-)
Thanks LD ;-)
Write an FC that determines the following data for an array:
1.DBNumber where array is located
2.Area pointer of start address of the array
3.The size of the array in bytes
4.The size of an array element in bytes
5.The size of the array in elements
The FC will have two any pointer input parameters, the first points to the array, the second points to an element of the array. The FC will use an any pointer return value to point to a udt containing the determined data for the array as detailed above.
Example call and UDT shown below:
New task. Write an FB that will search all DB's in the plc for a given word. Report the DB number and Area pointer for the first occurrence of the word. Exclude the instance DB used for the FB from the search. Search the DB only on even byte addresses. If the word is not found, set the DB number to zero. A risng edge on bStart will start the search and clear bFinished. The search may take place over several scans of the FB. When the search is complete bFinished should be true.
New Task (medium to difficult)
Write an FB that will ascertain the weaknesses of the Iranian Uranium Enrichment programme and use them to form the basis of a peace accord between the Palestinians and the Israeli's......
Write an FC that determines the following data for an array:
1.DBNumber where array is located
2.Area pointer of start address of the array
3.The size of the array in bytes
4.The size of an array element in bytes
5.The size of the array in elements
The FC will have two any pointer input parameters, the first points to the array, the second points to an element of the array. The FC will use an any pointer return value to point to a udt containing the determined data for the array as detailed above.
Example call and UDT shown below:
L P##pArray
LAR1
L D [AR1, p#0.0]
T MD 50
L W [AR1,P#2.0]
T #arrayInfo.wDBNumber