Help - Search - Members - Calendar
Full Version: 1746-HSCE2 Setup
Forums.MrPLC.com > PLCs and Supporting Devices > Allen Bradley
wsy_nte
Hi...
I have to used 1746-HSCE2 that connected to two encoders: 2048 PPR encoder that connected to Channel 0 and assign for length measurement (in mm), and another 1024 PPR encoder connected to channel 1 and used to indicate rotary knife edge position ( 0 - 360 deg). How to configure the 1746-HSCE2 for above requirement? Any idea?
Thanks.
James
panic mode
HSCE2 card can be nightmare to figure out because manual is so poor.
Person who wrote it should be punished (ok i will leave this to you...).

First you need to install card, create initialization routine as described in manual 1746-um002_-en-p.pdf

All the initialization routine does is transfer series of parameters to card.

Parameters are packs of 8 words. Word_0 of each parameter block contains parameter_ID (lower byte),
counter number etc. Words 1-7 are data. The actual work is figuring out what numbers to use
for parameter block setup. Depending on how many counters are to be setup and what is used (ranges etc.)
one will have more or less to configure.


Logic is as follows:

In your main program (LAD2) add rungs

CODE
SOR XIC S:1/15 BST MOV 0 N19:0 NXB OTU B3:5/13 NXB OTU B3:3/0 BND EOR
SOR XIO S:1/15 XIO B3:3/0 XIO B3:5/13 JSR 3 EOR


LAD3 file in this case should contain following logic

CODE
SOR LES N19:0 N19:1 XIO O:1.0/15 XIO I:1.0/15 BST COP #N18:[N19:0] #O:1.0 8 NXB OTL O:1.0/15 BND EOR  SOR XIC O:1.0/15 XIC I:1.0/15 BST OTU O:1.0/15 NXB MEQ I:1.0 6000h 0 ADD N19:0 10 N19:0 BND EOR  SOR EQU N19:0 N19:1 XIO O:1.0/15 XIO I:1.0/15 BST COP #N18:[N19:0] #O:1.0 8 NXB OTL B3:3/0 BND EOR  SOR BST XIC I:1.0/13 NXB XIC I:1.0/14 BND XIC I:1.0/15 OTL B3:5/13 EOR  


and you will need files N18 and N19
First one contains parameters for the HSC2 and second one holds just
two numbers ("current parameter" and "number of parameters to load").
As you can see two words are wasted since they use only 8 out of 10 words
per parameter set block.

Order of paramters doesn't really matter as long as you wait with enabling
of counters until end (this should be last block of data). Smart thing to do is
plan and organize....
For example make first parameter block disable counters, then do all other blocks
and in the end enable counters again. This way you don't have to reset or reboot plc
to load new parameter set. Just edit parameters in N18 file and retrigger very first rung
(add branch with another OSR bit around S:1/15).

Anyway, the basic parameters (N18:0..N18:69) would be something like this
(well this should be pretty darn close if not spot on for what you asked).
CODE
1, 101, 8, 0,0,0,0,0,0,0      ; Setup 2 counters blah blah blah
302, 1c,0,1c,0,0,0,0,0,0      ; Configure Gates
4, DFC3,FDA1,20C4,25E,0,0,0,0,0; Setup range for counter 0 (-8388607...8388606)
104, 0,0,4,5F,0,0,0,0,0       ; Setup range for counter 1  (0...4095)
8, FC18,0,3e7,3e7,0,0,0,0,0   ; Setup rate for counter 0  (-1000000...999999)
108, FC18,0,3e7,3e7,0,0,0,0,0 ; Setup rate for counter 1  (-1000000...999999)
80,8001,8001,0,0,FF00,0FFF,0,0,0; Enable both counters


All of these values are HEX. Put value 60 (60 decimal or 3C hex) into N19:1 and you are almost done.
Both counter are configured for X4 (gates setup) so you would get
4x2048=8192 and 4x1024=4096 pulses per revolution.
First counter uses full range. Second one is using only 4096 pulses (0...4095)
because it's single turn (you didn't mention any gearbox).

After this you will need to calculate positions:
CODE
SOR CPT F8:0  ( I:1.2 * 1000.0 ) + I:1.3  EOR
SOR CPT F8:1  ( I:1.8 * 1000.0 ) + I:1.9  EOR  


Scaling values should be simple enough.





wsy_nte
Thanks for reply.
I have to try the code, setup N19:1 = 60 (decimal) and I found the error bit B3:5/13 always set to 1. How to solve this problem?
Regards,
James

QUOTE(panic mode @ Jul 27 2006, 06:27 PM) [snapback]37380[/snapback]
HSCE2 card can be nightmare to figure out because manual is so poor.
Person who wrote it should be punished (ok i will leave this to you...).

First you need to install card, create initialization routine as described in manual 1746-um002_-en-p.pdf

All the initialization routine does is transfer series of parameters to card.

Parameters are packs of 8 words. Word_0 of each parameter block contains parameter_ID (lower byte),
counter number etc. Words 1-7 are data. The actual work is figuring out what numbers to use
for parameter block setup. Depending on how many counters are to be setup and what is used (ranges etc.)
one will have more or less to configure.


Logic is as follows:

In your main program (LAD2) add rungs

CODE
SOR XIC S:1/15 BST MOV 0 N19:0 NXB OTU B3:5/13 NXB OTU B3:3/0 BND EOR
SOR XIO S:1/15 XIO B3:3/0 XIO B3:5/13 JSR 3 EOR


LAD3 file in this case should contain following logic

CODE
SOR LES N19:0 N19:1 XIO O:1.0/15 XIO I:1.0/15 BST COP #N18:[N19:0] #O:1.0 8 NXB OTL O:1.0/15 BND EOR  SOR XIC O:1.0/15 XIC I:1.0/15 BST OTU O:1.0/15 NXB MEQ I:1.0 6000h 0 ADD N19:0 10 N19:0 BND EOR  SOR EQU N19:0 N19:1 XIO O:1.0/15 XIO I:1.0/15 BST COP #N18:[N19:0] #O:1.0 8 NXB OTL B3:3/0 BND EOR  SOR BST XIC I:1.0/13 NXB XIC I:1.0/14 BND XIC I:1.0/15 OTL B3:5/13 EOR  


and you will need files N18 and N19
First one contains parameters for the HSC2 and second one holds just
two numbers ("current parameter" and "number of parameters to load").
As you can see two words are wasted since they use only 8 out of 10 words
per parameter set block.

Order of paramters doesn't really matter as long as you wait with enabling
of counters until end (this should be last block of data). Smart thing to do is
plan and organize....
For example make first parameter block disable counters, then do all other blocks
and in the end enable counters again. This way you don't have to reset or reboot plc
to load new parameter set. Just edit parameters in N18 file and retrigger very first rung
(add branch with another OSR bit around S:1/15).

Anyway, the basic parameters (N18:0..N18:69) would be something like this
(well this should be pretty darn close if not spot on for what you asked).
CODE
1, 101, 8, 0,0,0,0,0,0,0     ; Setup 2 counters blah blah blah
302, 1c,0,1c,0,0,0,0,0,0     ; Configure Gates
4, DFC3,FDA1,20C4,25E,0,0,0,0,0; Setup range for counter 0 (-8388607...8388606)
104, 0,0,4,5F,0,0,0,0,0      ; Setup range for counter 1  (0...4095)
8, FC18,0,3e7,3e7,0,0,0,0,0  ; Setup rate for counter 0  (-1000000...999999)
108, FC18,0,3e7,3e7,0,0,0,0,0; Setup rate for counter 1  (-1000000...999999)
80,8001,8001,0,0,FF00,0FFF,0,0,0; Enable both counters


All of these values are HEX. Put value 60 (60 decimal or 3C hex) into N19:1 and you are almost done.
Both counter are configured for X4 (gates setup) so you would get
4x2048=8192 and 4x1024=4096 pulses per revolution.
First counter uses full range. Second one is using only 4096 pulses (0...4095)
because it's single turn (you didn't mention any gearbox).

After this you will need to calculate positions:
CODE
SOR CPT F8:0  ( I:1.2 * 1000.0 ) + I:1.3  EOR
SOR CPT F8:1  ( I:1.8 * 1000.0 ) + I:1.9  EOR  


Scaling values should be simple enough.





panic mode
QUOTE(wsy_nte @ Aug 2 2006, 12:29 PM) [snapback]37661[/snapback]
Thanks for reply.
I have to try the code, setup N19:1 = 60 (decimal) and I found the error bit B3:5/13 always set to 1. How to solve this problem?
Regards,
James


I would start with:
1. downloading and reading manuals, (specially pay attention to wiring instructions)
2. making sure high speed counter card and encoders are wired and powered correctly (switch setup, check voltages).
3. verify status of the card and channel LED status.
4. make sure that channel LEDs flicker when encoder is slowly turned by hand (as slow as possible).
5. create new plc program and add LAD3 and data tables as suggested.
6. make sure that card is in first slot or if not, adjust program accordingly
6. make sure CPU is in run or remote run mode.
7. cycle power. on powerup, initialization routine will be executed and it will move parameters to counter. if there is any parameter that card doesn't like, error will be generated. check what parameter is rejected by card by looking at N19:0. This value increments by 10 (0, 10, 20, 30 etc until reaching value in N19:1).

For example if the value is 20 then high speed counter card didn't like third block of data which in posted example is range setup for counter 0

QUOTE
CODE

1, 101, 8, 0,0,0,0,0,0,0       ; Setup 2 counters blah blah blah                 (N19:0 = 0)
302, 1c,0,1c,0,0,0,0,0,0       ; Configure Gates                                 (N19:0 = 10)
4, DFC3,FDA1,20C4,25E,0,0,0,0,0; Setup range for counter 0 (-8388607...8388606)  (N19:0 = 20)
104, 0,0,4,5F,0,0,0,0,0        ; Setup range for counter 1  (0...4095)           (N19:0 = 30)
8, FC18,0,3e7,3e7,0,0,0,0,0    ; Setup rate for counter 0  (-1000000...999999)   (N19:0 = 40)
108, FC18,0,3e7,3e7,0,0,0,0,0  ; Setup rate for counter 1  (-1000000...999999)   (N19:0 = 50)
80,8001,8001,0,0,FF00,0FFF,0,0,0; Enable both counters                            (N19:0 = 60)

panic mode
James,

what's going on? did you get this thing to work yet?

Regards,
wsy_nte
Hi..
I still have the problem with b3:5/13 always set to 1 after power-up. The n19:0 is 60. The connection to encoder module is A+ A-, Z+, Z-, encoder ppr for both channels is 2000 ppr.
Any idea how to solve the problem?
Thanks.
James
QUOTE(panic mode @ Aug 2 2006, 12:04 PM) [snapback]37664[/snapback]
QUOTE(wsy_nte @ Aug 2 2006, 12:29 PM) [snapback]37661[/snapback]
Thanks for reply.
I have to try the code, setup N19:1 = 60 (decimal) and I found the error bit B3:5/13 always set to 1. How to solve this problem?
Regards,
James


I would start with:
1. downloading and reading manuals, (specially pay attention to wiring instructions)
2. making sure high speed counter card and encoders are wired and powered correctly (switch setup, check voltages).
3. verify status of the card and channel LED status.
4. make sure that channel LEDs flicker when encoder is slowly turned by hand (as slow as possible).
5. create new plc program and add LAD3 and data tables as suggested.
6. make sure that card is in first slot or if not, adjust program accordingly
6. make sure CPU is in run or remote run mode.
7. cycle power. on powerup, initialization routine will be executed and it will move parameters to counter. if there is any parameter that card doesn't like, error will be generated. check what parameter is rejected by card by looking at N19:0. This value increments by 10 (0, 10, 20, 30 etc until reaching value in N19:1).

For example if the value is 20 then high speed counter card didn't like third block of data which in posted example is range setup for counter 0

QUOTE
CODE

1, 101, 8, 0,0,0,0,0,0,0      ; Setup 2 counters blah blah blah                 (N19:0 = 0)
302, 1c,0,1c,0,0,0,0,0,0      ; Configure Gates                                 (N19:0 = 10)
4, DFC3,FDA1,20C4,25E,0,0,0,0,0; Setup range for counter 0 (-8388607...8388606)  (N19:0 = 20)
104, 0,0,4,5F,0,0,0,0,0       ; Setup range for counter 1  (0...4095)           (N19:0 = 30)
8, FC18,0,3e7,3e7,0,0,0,0,0   ; Setup rate for counter 0  (-1000000...999999)   (N19:0 = 40)
108, FC18,0,3e7,3e7,0,0,0,0,0 ; Setup rate for counter 1  (-1000000...999999)   (N19:0 = 50)
80,8001,8001,0,0,FF00,0FFF,0,0,0; Enable both counters                            (N19:0 = 60)

panic mode
Value in N19:1 must be 60, not 96...
wsy_nte
Hi..
I change the n19:1 to 60 but the problem still exist.
Any idea?
Thanks.
James
QUOTE(wsy_nte @ Nov 7 2006, 12:09 PM) [snapback]43090[/snapback]
Hi..
I still have the problem with b3:5/13 always set to 1 after power-up. The n19:0 is 60. The connection to encoder module is A+ A-, Z+, Z-, encoder ppr for both channels is 2000 ppr.
Any idea how to solve the problem?
Thanks.
James
QUOTE(panic mode @ Aug 2 2006, 12:04 PM) [snapback]37664[/snapback]
QUOTE(wsy_nte @ Aug 2 2006, 12:29 PM) [snapback]37661[/snapback]
Thanks for reply.
I have to try the code, setup N19:1 = 60 (decimal) and I found the error bit B3:5/13 always set to 1. How to solve this problem?
Regards,
James


I would start with:
1. downloading and reading manuals, (specially pay attention to wiring instructions)
2. making sure high speed counter card and encoders are wired and powered correctly (switch setup, check voltages).
3. verify status of the card and channel LED status.
4. make sure that channel LEDs flicker when encoder is slowly turned by hand (as slow as possible).
5. create new plc program and add LAD3 and data tables as suggested.
6. make sure that card is in first slot or if not, adjust program accordingly
6. make sure CPU is in run or remote run mode.
7. cycle power. on powerup, initialization routine will be executed and it will move parameters to counter. if there is any parameter that card doesn't like, error will be generated. check what parameter is rejected by card by looking at N19:0. This value increments by 10 (0, 10, 20, 30 etc until reaching value in N19:1).

For example if the value is 20 then high speed counter card didn't like third block of data which in posted example is range setup for counter 0

QUOTE
CODE

1, 101, 8, 0,0,0,0,0,0,0     ; Setup 2 counters blah blah blah                 (N19:0 = 0)
302, 1c,0,1c,0,0,0,0,0,0     ; Configure Gates                                 (N19:0 = 10)
4, DFC3,FDA1,20C4,25E,0,0,0,0,0; Setup range for counter 0 (-8388607...8388606)  (N19:0 = 20)
104, 0,0,4,5F,0,0,0,0,0      ; Setup range for counter 1  (0...4095)           (N19:0 = 30)
8, FC18,0,3e7,3e7,0,0,0,0,0  ; Setup rate for counter 0  (-1000000...999999)   (N19:0 = 40)
108, FC18,0,3e7,3e7,0,0,0,0,0; Setup rate for counter 1  (-1000000...999999)   (N19:0 = 50)
80,8001,8001,0,0,FF00,0FFF,0,0,0; Enable both counters                            (N19:0 = 60)

panic mode
i don't see anything wrong with it. your ladder code is ok (in fact it's same as what I was using).
parameter loading is ok but it stops when you try to enable counters.
is this the only code you downloaded to plc? did you power down and power up plc?
your bit B3:23/0 should come on when init is complete.
wsy_nte
Hi..

I used 2000 PPR encoder for both channels, may this cause the error? Any number need to be change to accomodate 2000 PPR? I have cycle PLC power after download the ladder.
I hope this information will help. Any idea to solve this problem?
Thank you.
James

QUOTE(panic mode @ Nov 10 2006, 08:58 AM) [snapback]43342[/snapback]
i don't see anything wrong with it. your ladder code is ok (in fact it's same as what I was using).
parameter loading is ok but it stops when you try to enable counters.
is this the only code you downloaded to plc? did you power down and power up plc?
your bit B3:23/0 should come on when init is complete.


panic mode
changing counter preset ranges was explained above. but just having different preset value (as long as it's inside valid range) will not cause configuration fault. if the value is invalid, it will be rejected right away and the loading of parameters will stop at that block. you may have to contact tech support.
btw. did you read the manual and understand values in your parameter list?
wsy_nte
Thank you for reply.
I change counter parameter preset value It works with no parameter fault. I try to turn encoder and the reading is 2000 pulse and back to zero. For length measurement, the pulse reading should be accumulate and need to reset manually. How to solve this problem? and how to reset the counter reading?
Thanks again for help.
James

panic mode
Did you try something like this
CODE

1, 101, 8, 0,0,0,0,0,0,0    ; Setup 2 counters blah blah blah
302, 1c,0,1c,0,0,0,0,0,0    ; Configure Gates
4, DFC3,FDA1,20C4,25E,0,0,0,0,0; Setup range for counter 0 (-8388607...8388606)
104, DFC3,FDA1,20C4,25E,0,0,0,0,0; Setup range for counter 1 (-8388607...8388606)  <-----<<<
8, FC18,0,3e7,3e7,0,0,0,0,0 ; Setup rate for counter 0  (-1000000...999999)
108, FC18,0,3e7,3e7,0,0,0,0,0; Setup rate for counter 1  (-1000000...999999)
80,8001,8001,0,0,FF00,0FFF,0,0,0; Enable both counters


and reset should be:
for counter0 O:n/17 (O:n.1/1)
for counter1 O:n/33 (O:n.2/1).
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.