bunkerpete Posted April 8, 2009 Report Posted April 8, 2009 Hi All, I have an A2 PLC with various cards and I program in GX. I can use the digital inn’s and out's no probs but I am now trying to use my a1s68ad analogue input card. I’m trying to read a humidity sensor (4 - 20mA) to control some de-hums. I have read all of the related posts and understand some of the code put up. So my question is dose anybody have some simple code with notes / comments on it explaining exactly what each bit dose. Before I get a hale of R.F.M. I have read the manual several times and still don’t understand it. Many thanks for any help.
Crossbow Posted April 8, 2009 Report Posted April 8, 2009 The data in the intelligent modules is in buffer memory in the module. You need to use the FROM instruction to read this data into the PLC. The card also has discrete input and output points allocated, and you may need to turn on an output or read an input. There is example code in the manual. (Not that this is one of the RTFM posts you mentioned, but there is an example in the product manual) Read buffer memory 20-27 to get the 8 input values.
bunkerpete Posted April 9, 2009 Author Report Posted April 9, 2009 That’s great; I’m getting some values out! But I want to move the card up the rack. I have moved it to slot 1 and now can't seem to read from it anymore. At the mo I have: Slot 0 16 point output Slot 1 AD card (32 point) So I thought the code should go from "FROM H0 K20 D100 K1" To "FROM H10 K20 D100 K1" But no, the CPU spits the dummy out. I would like to move the AD card to slot 2 but I’m having enough trouble shifting it to slot 1 Slot 0 16 out Slot 1 32 in Slot 2 AD I’m sure I’m missing something simple but as always any help would be appreciated.
panic mode Posted April 10, 2009 Report Posted April 10, 2009 because you are reading from wrong card. if you have: Slot 0 16 out (y000-y000F) Slot 1 32 in (x0010-x002F) Slot 2 AD (x0030-x003F, y0030-y003F) Slot 4 (?0040-????) that means that first card (slot 0) will use addresses 0000-000F. next card will use addresses 0010-002F the analog card will use addresses starting at 0030 etc. (i think it's 16 pt for analog in , not sure) note that those are BIT addresses. when using TO and FROM you have to use WORD level addresses (since in hex, just drop the last digit, 0030 -> 003). that means that AD card will have head address 003H so command should be "FROM H003 K20 D100 K1" command "FROM H10 K20 D100 K1" will read from card that has head address 010 which means I/O range 0100-01xx (probably slot 6 or 7 or so)
panic mode Posted April 10, 2009 Report Posted April 10, 2009 no, that would read from the card he has in slot1 - which is 32 digital inputs: address range X0010-X002F ==> start address 0010 (bit address) ==> head address 001 (word level - just removed last digit from start address).
bunkerpete Posted April 10, 2009 Author Report Posted April 10, 2009 (edited) Thanks again guys, that’s sorted it. Now all iv got to do is make sense of the numbers I must say the last 3 weeks have been a vertical learning curve, I love it! Edited April 10, 2009 by bunkerpete
panic mode Posted April 10, 2009 Report Posted April 10, 2009 this is taken from manual IB(NA)800243E-T (6.4.13 Changing Module's first I/O number):
panic mode Posted April 10, 2009 Report Posted April 10, 2009 actually it is very simple, it is linear. the only thing is that it uses hexadecimal addressing: when you add modules in a project's parameter, they all get assigned address range. if the card uses 16bit then it is asdsigned 16 points, 32 means 32 points etc. when you convert those numbers to hex, you will see that 16=h10, 32=h20 etc. addresses start from zero so in your case, first card has 16 points, next one has 32 etc. that means that firsty one uses points 0-15 (total=16), next one is 16-47 (total=32) etc. when you convert those numbers to hex (we only care about BEGIN of the range or START ADDRESS) those would be (in your case): 0 for first card, (0-15 decimal or 0-F hex) 16 for second card (16-47 decimal or 10-2F hex) 48 for third card (48-?? decimal or 30-?? hex) etc. as you can see those cards have start addresses h0, h10, h30 etc. (bit addresses) when using TO and FROM instruction for module's head address just remove last zero (in your case head addresses h0, h1, h3 etc.)
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now