VersaMax High Speed Counter

Steve Etter

Lifetime Supporting Member + Moderator
Join Date
Apr 2002
Location
Morristown, TN
Posts
965
Hi.

I am having trouble setting up a High Speed Counter using the VersaMax PLC. If anyone can help, I sure would appreciate it.

I am attempting to use a GE Fanuc VersaMax PLC for the first time with a IC200MDD841 module. This module is to be configured to accept a single A-Quad-B encoder whose job it is to monitor forward and reverse movement. With the push of a button, or the detection of a specific prox switch, I need to zero the position.

Now, here is what I have so far:
  • The module is programmed as a "2 Type A & 1 Type B"
  • The encoder is wired to terminals B1 and B2.
  • As per the hardware configuration, it uses %I17 -> %I56, %Q17 -> %Q48, %AI5 -> %AI17, and %AQ3 -> %AQ22.
  • I have been able to determine that the module is reading the encoder OK and that the accumulator value for these inputs appears to be %AI12.
All I need this to do is read in both directions, cross over zero and start reading negative (at least the final value I will display on my MMI needs to display negative), and then reset to zero when told to.

I have read through most every bit of literature I can find for the module, but none of it really seems to help.

Any help would sure be appreciated.

Thanks,
Steve
 
You'll need to configure values for high and low limits for the counter. The default values are 0 for low limit and 32767 for the high limit, so you need to set a negative value for your low limit.

To set the value to zero, you'll need to execute a COMREQ instruction from ladder logic. The instructions are defined in GFK-1504, chapter 13. You'll need to use the 'Load Accumulator' command.

If you need help setting up the COMREQ, I can post an example here or you can contact me via private message and I'll email you my telephone number. That way I can talk you through the process and one of us can post the results here for all to see.

I don't have a VersaMax with an MDD841, but I do have a 90-30 HSC module. The COMREQ commands are common to the two platforms.
 
Thanks Steve,

I have been reading the GFK-1504J, page 13-27 about the COMREQ command but it really doesn't make much sense to me.

I, too, have been using the HSC from a 90-30 for some time. Someone else had already set it up a couple of years ago so I really don't know the ins-and-outs of it :oops:

I attempted to use the BLKMOV WORD and COMREQ commands from the 90-30 but, for some reason, they don't seem to do the job.

Please, if you will, post anything you can here. I hate to show my ignorance so publicly, but if others can benifit too, then it is worth the humiliation.

I would post the logic I am attempting to use but I do not have access to a web page where I can post pictures. If there is another way to get a picture on here, I sure would like to know about it.

Steve
 
Here's a 90-30 HSC reset example with some extra CR characters, but still readable. You may have to modify the COMREQ to indicate the peoper location for your MDD841, and the %R assignments to line up with your available registers.
If this doesn't work, we may want to talk by phone so we can try things out in real time and then post the results here.


|[ START OF LD PROGRAM HSC ] (* *)
|
|[ VARIABLE DECLARATIONS ]
|
|[ BLOCK DECLARATIONS ]
|
|[ START OF PROGRAM LOGIC ]
|
| << RUNG 4 STEP #0001 >>
|
|%I0001 %M0002
+--] [---------------------------------------------------------------------(^)--
|
| (****************************************************************************)
| (* These two Block moves prepare the COOMREQ function. In this example, *)
| (* the COMMREQ will zero the accumulator of counter #1 in a Type B HSC *)
| (* in Rack zero, slot 4. Note that the Block Move instructions both use *)
| (* WORD data type, so the values for the constants are are all displayed *)
| (* as hex numbers. *)
| (* *)
| (* In the first Block Move, the constants for IN1, IN2, IN5, IN6, and IN7 *)
| (* are always the values shown here. The value of 8 at IN2 defines using %R *)
| (* memory for the COMREQ status word, and the value of 2A (42 decimal) *)
| (* points to %R43 as the specific location. *)
| (* *)
| (* In the second Block Move, IN1 is always 6. It defines the length of the *)
| (* block of data to be sent to the HSC (6 bytes). IN2 and IN3 define the *)
| (* starting address of the six bytes of data. The value of 8 at IN2 *)
| (* specifies %R memory, the 27 (39 decimal) at IN3 specifies %R40 as the *)
| (* starting address of the six bytes of data. The 0101 at IN4 is the *)
| (* command to load the accumulator of counter #1. The zeros at IN5 and IN6 *)
| (* are treated as a 32-bit number and represent the value to load into the *)
| (* accumulator. *)
| (* *)
| (* To load the accumulator for counter #2, use a value of 0201 at IN4. *)
| (****************************************************************************)
|

Program: HSC C:\LM90\FOLDERS\HSC Block: _MAIN
11-19-02 10:17 GE FANUC SERIES 90-30/90-20/MICRO (v9.02) Page 2



| << RUNG 6 STEP #0004 >>
|
|%M0002 %I0001 +-----+ +-----+
+--] [-----] [---+BLKMV+-----------------+BLKMV+-
| | WORD| | WORD|
| | | | |
| CONST -+IN1 Q+-%R0030 CONST -+IN1 Q+-%R0037
| 0004 | | 0006 | |
| | | | |
| CONST -+IN2 | CONST -+IN2 |
| 0000 | | 0008 | |
| | | | |
| CONST -+IN3 | CONST -+IN3 |
| 0008 | | 0027 | |
| | | | |
| CONST -+IN4 | CONST -+IN4 |
| 002A | | 0101 | |
| | | | |
| CONST -+IN5 | CONST -+IN5 |
| 0000 | | 0000 | |
| | | | |
| CONST -+IN6 | CONST -+IN6 |
| 0000 | | 0000 | |
| | | | |
| CONST -+IN7 | CONST -+IN7 |
| E201 +-----+ 0000 +-----+
|
| << RUNG 7 STEP #0008 >>
|
|%M0002 +-----+
+--] [-----------+COMM_|
| | REQ |
| | |
| %R0030 -+IN FT+-
| | |
| CONST -+SYSID|
| 0004 | |
| | |
| CONST -+TASK |
| 00000000 +-----+



It looks like the value for IN7 needs to be 3 for VersaMax HSC and the IN4, IN5, and IN6 values from the second BLOCK MOVE should be moved to IN1, IN2, and IN3 respectively. IN4 - IN7 in the second BLOCK MOVE are unused with VersaMax.
 
Last edited:
Ok. From your example and cross referencing with the GFK-1504 manual, here is what I see:

As long as I have the proper constant values in the other positions in the BLKMV WORD commands all I have to worry about on them are IN3 and IN4 in the first one and IN1, IN2, and IN3 in the second.

First Block Move:
Q = %R30 -> Registers 31 through 37 will be filled with the values in IN1 -> IN7
IN1 = 0004
IN2 = 0000
IN3 = 0008 -> Indicates to use %R values
IN4 = 002A -> Says the COMREQ Status Word is in %R43 (2A is HEX for 42 DEC)
IN5 = 0000
IN6 = 0000
IN7 = 0003

Second Block Move:
Q = %R37 -> Registers 38 through 44 will be filled with the values in IN1 -> IN7
IN1 = 0101 -> Says load the accumulator in Counter #1
IN2 = 0000 -> MSB to be loaded to accumulator is 0
IN3 = 0000 -> LSB to be loaded to accumulator is also 0
IN4 = 0000
IN5 = 0000
IN6 = 0000
IN7 = 0000

COMREQ Command
IN = %R30 -> same as the %Q value on the first block move.
SYSID = 0004 -> indicates the HSC module in rack 0, slot 4.
Task = 0000 -> task ID (did not find much info on this)

Now in my particular case, using the VersaMax, I have thee other modules in between the processor and the HSC. This seems to me like it ought to be the 4th slot in Rack 0 so the value for SYSID should be 0004. Also, by looking at the hardware configuration for the module (automatically generated, by the way), my encoder is connected to counter #2. Therefore I need a value of 0201 for IN1 on the Second Block Move.

Furthermore, the COMREQ Status Word is the location where any error codes would be placed. It does not necessarily have to be used for any other control.

Does that all sound about right?

Steve
 
Yippeee!

It works!

Thanks Steve. Don't know when or if I might have figured that out without your help.

Next round is on me
beerchug

Steve
 
It all sounds right, Steve. The CPU is considered Rack 0, slot 0. If there are three modules between the CPU and the MDD841, then the MDD841 would be Rack 0, Slot 4, and the value for the SYSID parameter would be 4.

You're also correct about the 0201(hex) defining the command to load the accumulator for counter #2.

Now that we've gone through all that trouble, I just read enough of the manual to see that there is an easier way.

Versa Max HSCs support direct commands in the %AQ registers assigned to the module.

You simply move the 0201(hex) into %AQ001, and at the same time move zero into %AQ0012 and %AQ0013. Trigger the move with a one-shot and immediately afterward move zero into %AQ0011. You can forget about the COMREQ.
 
Hello guys,

I have this module mdd841 reading an incremental encoder EG7C, this encoder specifies 1024 pulses/revolution.
I connected two wires in B1 and B3 channels on the module, but, I'm reading (PLC GE FANUC 90-70) in the proficy machine edition 4096 pulses / revolution. Is there any configuration that I can do to change it? Even less then 1024 pulses?

Thank you and best regards
 
I see is old post, but maybe someone can help, I have encoder 1024 ppr, 24Vdc with A/-A B/-B channels, encoder is powered on with 24Vdc to B1 and B3 connected A and B, B17 0Vdc, counter 1 is enabled in HW but on counter 1 AI address no pulses, when rotating encoder i can measure and see between A to 0vdc there is voltage changing between 0-24Vdc. is there anything's to enable on Q like open software gate or similar. Card manual seems pretty banal, not much explained. do not even understand whats type A, type B counter, thanks
 

Similar Topics

Hi everybody, I registered to this forum because I simply can't figure it out, how to properly set HSC in Proficy Machine Edition for my Versamax...
Replies
17
Views
3,796
Can someone point to a source for learning how to program in Proficy Machine edition a high speed counter that reads my turck encoder? I am using...
Replies
3
Views
2,225
Hi Everyone, I own a GE Versamax controller that I purchased for a class at Long Beach City College a couple of years ago. I lost the use of my...
Replies
1
Views
44
I have one GE Fanuc IC200PNS002-AC Versamax Network Interface Module and the fault red light is blinking and i have checked in manual it is...
Replies
9
Views
247
Hi, The VersaMax PLC suddenly stop running (no LED on run function) so I'm trying to upload the program. The HMI connected to it says "Host...
Replies
0
Views
149
Back
Top Bottom