Question qbout temps

userxyz

Member
Join Date
May 2002
Location
any
Posts
2,768
Hey

Hi,

I programmed some things in an FC. But I used 3 bits that had to be remembered, so I made a struct of 8 bits in the temp area. It is called MemoryByte.

So I wrote this in the first network:

LAR1 P##MemoryByte
L #MEMORY
T LW [AR1,P#0.0]

and this in the last:

LAR1 P##MemoryByte
L LW [AR1,P#0.0]
T #MEMORY

MEMORY is an IN_OUT, on the outside of the block I connected MB75. See images.

The bits are not remembered, How come ?




outtt.JPG


inttt.JPG
 
TEMPs are only valid during the current cycle. If you need to remember data then you either have to use Marker Bits (Bytes) or else create your program in an FB and store your data in STATs which as the name implies are static - i.e. available in future cycles, because they are held in the Instance DB.
 
Hey

I know that I can use FB with an instance DB, but I don't want it for simple tasks where I only need 3 bits to be remembered.

So the idea is making one byte of memory on the outside of the FC. Therefor MB75, these bits are red in the FC in network 1 and are written to MB75 in the last network.

read write principal,

should work .., but it doesn't
 
If its only 3 bits why don't you assign them as IN_OUT's?

EDIT:

The other common error is of course if you made MEMORY an IN parameter, this would not work!
 
Last edited:
just noticed you are transferring a byte to LW, the bits you are trying to remember are in the low byte!!

LW0 = LB0 and LB1, your memory will be in LB1, the assigned bits are in LB0
 
Hey

indeed,

I made it to LB and it was gooooood,

I was monitorring on it, then have seen that MB75 remained zero. And wrote this:

begin of FC

L MEMORY
T LB2


end of FC

L LB2
T MEMORY

And nodest the LW..

second time I made this error
 

Similar Topics

Hello all, I have a servo turning a small table on a machine I'm programming. I found that after a day the home position was getting off by a...
Replies
1
Views
67
Hi, I just upgraded just restored a ftview hmi data and the trend file have question marks with no lines in the graph. How do i fix this?
Replies
0
Views
24
Hey all, simple question. Once I create a Macro in my Factory Talk Project, do I need to trigger the macro to run somehow? Or are all macros...
Replies
8
Views
139
I recently uploaded an aplication from a Panel View, created a new screen and now that I've downloaded it to the Panel View, all the texts have...
Replies
9
Views
179
I have never had the pleasure of working with a "Thermistor" until now and have a question. The Thermistor is a 10KOhm 4-20mA 2-wire device and I...
Replies
4
Views
171
Back
Top Bottom