Little Help With TISOFT

Brian E

Member
Join Date
Sep 2003
Location
Vancouver, WA
Posts
14
In the MOVW Instruction what does the N=16 reference?

Thanks
Brian


|DUMMY COIL MOVW1---------+ RESET TABLE
|ALWAYS | | SET EQUAL

|OFF | | TO ZERO

| C100 | | C102

4 *----]/[-----| |-----------------------------------( )

| 1 | A:+0 |

| | RESET IMAGE |

| | REGISTER |

| | TO ZERO |

| | B:V101 |

| | N=16 |

| +-------------+
 
Brian E and I have known each other for many years. We are next door neighbors relatively speaking. We have visited each others offices and talk on the phone from time to time. He knows I kwow about TI plcs. I know he has programmed TI plcs in the past. I also know it was a long time ago. Notice we are both from Vancouver, Wa.

Gerry, I have MUCH MUCH more to lose than Terry when Siemens stops making TI505 and the support chips. Terry is just more vocal. Are you aware that my company makes motion controllers for the TI505? We have sold many and until about 1999 or 2000 the motion controller we make for the TI505 was our best selling motion controller. Terry knows this. He knows I am sincere and not trying to rattle him.

What most of you don't know is that the TI505 is far ahead of its time. Only the Control Logix can now challenge the TI505 back plane. The TI 505 back plane has a feature called pseudo DMA. This allowed intelligent modules such as our motion controller to read and write data out of PLC memory. This technology should have been enough to kick Rockwell's butt in the '80s and '90s but Rockwell's superior marketing and software has just about eliminated TI/Siemens from the forest product industry in the NW US. In some respects I/we have been responsible for the last few nails in the coffin.
 
More than you wanted to know?


+-------------+
| MOVW |
| |
| A:+0 |
| |
| RESET IMAGE |
| REGISTER |
| TO ZERO |
| B:V101 |
| N=16 |
+-------------+


Brian E asked...

"In the MOVW Instruction what does the N=16 reference?"

Cutting to the quick, the manual says that "N" refers to the number of words to be copied. (I hope everyone realizes that a "Move" is really a "Copy" in that it does NOT leave an empty location behind... unless of course, it was empty to begin with.)

Since "A:" is a constant ("+0"), the instruction copies "+0" to "N-consecutive" word locations starting at V101.
Here is a very simplistic (and somewhat misleading) way of looking at it...

MOVW
A: +0
B: V101
N=4

("=>" means "goes to")

"N" A: B:
(1) +0 => V101
(2) +0 => V102
(3) +0 => V103
(4) +0 => V104


If the element in "A:" is a readable word location (ex: V201), then "N" greater than 1 indicates that this will be a Table Move (copy) consisting of N-elements. This also is a simplistic (and again, somewhat misleading) way of looking at it...

MOVW
A: V201
B: V101
N=4

("=>" means "goes to")

"N" A: B:
(1) V201 => V101
(2) V202 => V102
(3) V203 => V103
(4) V204 => V104


The actual steps in the instruction are much more involved...
(This might not be exactly how it works... if not, it's damned close!)

The instruction uses an Internal Index.
The initial value of the Internal Index is "0". This value serves as an "Offset".

A: V201 is the Base Address of the Source.
The Internal Index is the offset from the Source Base Address.

B: V101 is the Base Address of the Destination.
The Internal Index is the offset from the Destination Base Address.


First Pass... N = 4, Internal Index = 0

Compare the Internal Index to "N".
If the Internal Index = "N" then the instruction is DONE. (If "N=0" then no words are copied).
COPY "Source Base Address + Index" to "Destination Base Address + Index".
That is, COPY "V201 + 0 = V201" => "V101 + 0 = V101"
Increment the Internal Index (0 +1 = 1)

Second Pass... N = 4, Internal Index = 1

Compare the Internal Index to "N".
If the Internal Index = "N" then the instruction is DONE.
COPY "Source Base Address + Index" to "Destination Base Address + Index".
That is, COPY "V201 + 1 = V202" => "V101 + 1 = V102"
Increment the Internal Index (1 +1 = 2)

The loop continues until the Internal Index = "N".

Here it is in table-form...

MOVW
A: V201
B: V101
N=4

("=>" means "goes to")

Before each pass... Compare Internal Index to "N". If GT or EQ to "N", then DONE.
If N = 0 then no passes are executed... the instruction is done before it starts.


Internal
PASS "N" Index A: + Index = Source => B: + Index = Destination INC Index

1 (4) (0) V201 + 0 = V201 => V101 + 0 = V101 0 + 1 = 1

2 (4) (1) V201 + 1 = V202 => V101 + 1 = V102 1 + 1 = 2

3 (4) (2) V201 + 2 = V203 => V101 + 2 = V103 2 + 1 = 3

4 (4) (3) V201 + 3 = V204 => V101 + 3 = V104 3 + 1 = 4

5 (4) (4) Internal Index = "N"... DONE!


Notice that "N" acts as an Index Limit. When the Internal Index is equal to "N" then the instruction is DONE.

The default value for N is "1". This causes at least one word to be copied... otherwise, what's the point? Initially, the instruction starts with an Internal Index value of "0". Before executing a move (making a pass), the instruction compares an Internal Index to "N". If the Internal Index = "N" then the instruction is DONE.

Actually, internally, there is still a bit more going on than shown...
V201 is NOT an actual address! It is only a NAME of a particular address! The specific memory address is more involved than simply "V201". But that is beyond this particular discussion.

Does that answer your question Brian? (Probably more than you needed or wanted to know...?)

BTW, "RESET IMAGE REGISTER TO ZERO" sounds like a perfectly ridiculous name for V101. It makes no sense at all.


Peter said...
"MOVW is very similar to an AB MOV only not as flexible."

This is true... MOVW is not very flexible. That is why TI has the MOVE (Move Element as opposed to Move Word) Instruction.

The MOVE instruction is much more powerful than the MOVW instruction. I don't think any vendor has a more powerful version of this instruction. Equal, maybe, more powerful... I doubt it.

Peter also said...
"Only the Control Logix can now challenge the TI505 back plane."

As in... AB is finally coming up to speed. I can't argue with that. In fact, they have gone a few steps further by implementing tag-oriented element names. This kind of programming goes back to the early 80's when DEC introduced VMS (Virtual Memory System). No longer did a programmer have to keep track of all of the memory locations by address... now the system did it automatically through virtual naming.

For those that aren't aware of it... "C"-type programming in PLCs is slipping in right under your noses! Control Logix is very much like "C".

But I gotta say... I absolutely hate their programming interface display and their program print-outs. They still have a ways to go in that respect.

And yes, I certainly know that Peter has depended on TI-505 business for quite a while. I have a couple of his motion control cards installed (although I'm replacing those with a pair of standard analog output cards).

I know that Peter has much respect for the TI-505 line.

BTW, Brian...
Do you, or have you used CVU?
 
Last edited:
Thanks

It has been a long time since I have played with TI. I find the MOVW is similar to the COP instruction, where the integer constant is the number of words being moved. I also found a couple of manuals online that have been helpful.

Terry,
CVU? Operator Displays? We had them, but somebody else programmed them on TI jobs.

Thanks
Brian
 

Similar Topics

I am trying to use pylogix to write to a string array ID_Data_Table_Name. In the array there are 200 possible entries. For...
Replies
13
Views
3,991
Hey guys, I have a client that has a v-notch chlorinator that doesn't run off a 4-20mA loop, it instead has two discrete inputs that drive the...
Replies
6
Views
1,841
Hey all. I need some guidance here. This is something I came across today when a Ref guy noticed that the HMI isn't displaying the correct time...
Replies
2
Views
1,430
i am a beginner plc programmer and have some confusion, a little help would be appreciated . why do we use a normally close contact when we are...
Replies
11
Views
2,852
Hello everyone! So, for my job I need to use the web server of a S7-1200 for setting some variables. Thing is, since I'm not the only one using it...
Replies
1
Views
1,358
Back
Top Bottom