DB pointer ?

Berra

Member
Join Date
Mar 2007
Location
Sweden
Posts
137
hi,
Someone you can give me som tip?
I have 10 engines that I have created in a UDT, and each engine has a starting address. Engine 1 has the starting address 0. but the speed variable of the engine has the address 6.0 how can i make the pointer point to that address ?

This dosen´t seems to work:
OPN "motor_lista"
l # pointers
SLW 4
lar1
L 50
t dBW. [AR1, P # 6.0]


/ Thomas
 
You do not show the processing for the "pointers" variable.

Copy the relevant blocks to a library and post the archived library. We can then see the udt layout etc.
 
Ok, here is the File of udt.
i saw have type the wrong adress for the speed variable it should be address 4.0 in udt.
 
...
Code:
      L     5                           //for test
      T     #iMotorNumber
      L     6                           //constant for UDT
      T     #iSizeOfMotorUDTInBytes
 
      OPN   DB     3
      L     #iMotorNumber               //make zero based
      +     -1
      L     #iSizeOfMotorUDTInBytes
      *D    
      SLD   3                           //convert to pointer format
      LAR1  
      L     50
      T     DBW [AR1,P#4.0]             //speed setpoint
 

Similar Topics

I have a word in some DB which I want to load to AR1 and use as a pointer. In order to do this I need to write L DBxy.DBW xy SLD 3 LAR1 I...
Replies
3
Views
526
I am trying to access the value of a pointer via OPC UA in Codesys. I can share it directly and in a struct but I cant access the value of it when...
Replies
5
Views
1,596
Why does my deconstruction of the input pointer only work with its own instance DB not inside the multi instance FB...See .doc The pointer at the...
Replies
8
Views
2,328
Hi All, in many library function of TiaPortal some data must be write using the pointer format........ eg.: P#DB90.DBX0.0 WORD 10 is it...
Replies
5
Views
2,817
I have a very strange issue and I cannot figure out why it is not working. I read input of type pointer and store it to local temp type any. I...
Replies
4
Views
1,922
Back
Top Bottom