Pointers in STL

Rogalson

Member
Join Date
Jun 2015
Location
Poland
Posts
5
Hey guys.
I have problem with pointers in STL. My program has to write 255 to MB [ MD 300]. Let's say I write 20 to the MD 300, MB [20]=255, I tried to do this way, but it doesn't work.
Code:
L MD 300
LAR 1
L 255
T B [AR1 , P#0.0]
 
There are two errors in your code.
1) The left 3 bits in the address register are for the bit-addresses .0 - .7. So you have shift the value you want to access by 3.

2) If you want always access M area, you are using a so called register-indirect area-internal addressing. You have to specify the memory area you want get access to

The code should be
Code:
L MD 300
SLD 3
LAR 1
L 255
T MB [AR1, P#0.0]
 

Similar Topics

Hello, I try to understand a function block where a string is copied from an address (source) to another address (destination) by using...
Replies
4
Views
7,480
Hi, I'm trying to write a FB which shows daily shift performance. Instead of just displaying everything, i want to increment/decrement the day to...
Replies
3
Views
1,802
Hello, I've just came out of a call where a program that was modified two weeks ago threw the processor into fault. The program has been done...
Replies
9
Views
3,462
I'm trying to get a 5069-L306er to talk to a Automation Direct ProSence Controller by using RA's AOI for modbus client but its stuck not getting a...
Replies
9
Views
1,876
The last time I did anything with Wonderware was just after the dot com bust. Boy, I feel old. Anyway, it looks like I will get the chance to...
Replies
3
Views
1,507
Back
Top Bottom