MOV Instruction

oxlacey

Member
Join Date
Aug 2012
Location
SC
Posts
38
This should be easy (I hope).

I have a MOV statement with no conditional. I want to move 6 into Number (integer).

However, it never happens. Number remains 0.

What am I missing?!
 
In addition to checking to make sure the subroutine is being called make sure that something else is not clearing the integer register.
 
oh my gosh i feel like the village idiot. sorry for that guys, it's been a while since i've actually had to program! i forgot to call the task.

OK. now that works.

I want to put a variable into a tag called Rack_Contents that is a DINT with 13 elements (for 13 racks).

How do I move a value of "6" into Rack_Contents for rack number 11?

I can do this with 2 MOV statements; is there a way to do this with a single MOV?
 
Last edited:
It kind of depends on how you refer to the 'Rack Number'

Is Rack_Contents[0] called "Rack 0"? If so then rack number 11 is Rack_Contents[11] and placing a "6" in it would be:

MOV 6 Rack_Contents[11]

But realize this method means you cant have a Rack Number 13. The last one would be rack number "12"
 
Last edited:
I want to put a variable into a tag called Rack_Contents that is a DINT with 13 elements (for 13 racks).

It kind of depends on how you refer to the 'Rack Number'

Is Rack_Contents[0] called "Rack 0"? If so then rack number 11 is Rack_Contents[11] and placing a "6" in it would be:

MOV 6 Rack_Contents[11]

But realize this method means you cant have a Rack Number 13. The last one would be rack number "12"

I make arrays one element larger when needed so for 35 racks numbered 1 to 35 I create my array as 36 elements. You get Rack[0] to Rack[35], and you don't use rack[0]. It wastes an element, yes, but it is simpler to program.
 
Last edited:

Similar Topics

Is K4M101 a constant? Is K7 a constant? What does this instruction do? Thanks
Replies
19
Views
5,089
I have to create a sample mov template in add on instruction.I just want to know the list of tags which is used to create a mov logic instruction...
Replies
6
Views
2,090
Good evening! I am having trouble making this work. I need the counter to count up to 3 seconds if the DI_01 is off, and to count up to 30s if...
Replies
2
Views
2,119
Hi everyone, I have a short question about BLKMOV instruction, illustrated in the image below. I have the same piece of code in STEP 7 (ET200S)...
Replies
2
Views
2,697
Hey I was having some problems with a MOV instruction. I have a pressure that once it reaches a certain pressure I want it to close two valves...
Replies
14
Views
2,418
Back
Top Bottom