Sign in to follow this  
Followers 0
dunc

confused with Q series analogue input setup?

12 posts in this topic

looking at setting up a new analogue input card. looked at the manual and the example on the forum and it all makes sense apart from the initial enable channel setup. im using a Q64AD on a Q02 CPU. manual states: [TO H0 K0 H8 K1] this enables channel 1-3 according to the manual??? the example on this forum states: [TO H3 K0 K10 K4] this enables channel 1-4 I have found an example on one of our other PLC's (with a Q68AD) which is different again: [TO H5 K0 H0 K1] this has all 8 channels enabled could someone please help explain this as I cannot see any logic in these instructions!?!? I get the TO H%, its just the rest of the instruction that is confusing me. thanks Duncan

Share this post


Link to post
Share on other sites
First of all there are two ways to set up this card. Via a sequence program or via the special function utillity Which software are you using?

Share this post


Link to post
Share on other sites
apologies. via sequence program using TO commands. GX developer 8.8

Share this post


Link to post
Share on other sites
sounds like you need to lookup TO and FROM instructions in the instruction manual. they are used to exchange data with intelligent/special modules (any module other than simple DI/DO is intelligent/special). format for 16-bit instruction is: TO n1 n2 S n3 where n1 is "head address" of the card. this depends on how the card is addressed (where in rack it is). n2 is address of begin of block in the buffer that is being written S is source address (where the copied data comes from) n3 is length of data block being written (number of elements being copied) there are also DTO (32bit, instead of 16bit) etc. to configure card you need to see what the buffer locations do, this is described in the card manual. all manuals assume that card you are working with is using head address zero (usually means that this is first card in the rack) so you need to make correct adjustments to the addressing (also applies to any code sample in the manual).

Share this post


Link to post
Share on other sites
maybe check topics like: http://forums.mrplc.com/index.php?showtopic=1104

Share this post


Link to post
Share on other sites
this is where I am confused, the card manual isn't very clear. usually I can look at a few examples and work out what is going on, but in this case the last 2 elements of the instruction make no sense to me. I understand the TO, I understand the head address, I understand the n2 as these are all common across the instructions. what I cant get is why the instructions I posted use a different source address (s) and data block length to be written (n3) to basically achieve a similar thing?

Share this post


Link to post
Share on other sites
Dunc For example the source address could be D500 so the value in D500 would be sent too channel 1. n3 would be how many channels you are writing too. D501 to channel 2 and so on. Rodney

Share this post


Link to post
Share on other sites
I kinda get that. its just I cannot correlate the 3 instructions I posted to what they are doing? in the instructions above that specify a hex number as the source address, what does this relate too, a buffer location in the specified card or literally a hex number as per the second example using a K constant as the source? I am really struggling to get my head round it and I apologise!

Share this post


Link to post
Share on other sites
Channel enable BFM 0 [TO H0 K0 H8 K1] (K8 - binair 1000) means channel 1 2 3 are 0 enabled channel 4 =1 so disabled) H0 instead of H8 will anable all channels averaging value BFM 2,3,4,5, TO H0 K2 K50 K4 (averages of 50 samples or ms for channel 1,2,3,4) averaging yes/no time based or sample based (BFM 9) TO H0 K9 Hxxx K! For Hxxx see attachment (H0F0F = means averaging for all channels time based) Dn't forget to set Y9 after you have made your settings Edited by Gambit

Share this post


Link to post
Share on other sites
right, thankyou for that explanation. I think I now understand how it works in the manual description and the example I found on another plc. if this was an 8 channel card and I wanted to enable channels 1-7 would I do it as follows: [TO H0 K0 H80 K1] ? I still cant see how that would work for the middle example I posted which is from the program examples on this forum: [TO H3 K0 K10 K4] how would that enable all 4 channels? thanks for being patient with me so far. Duncan

Share this post


Link to post
Share on other sites
0 is enable so wrinting H0 would be fine If you sen H80 that is binairy 1000 0000 which would mean Ch1-Ch7 enable but ch8 disable Channel maybe this is more clear: 8 7 6 5 4 3 2 1 1 0 0 0 0 0 0 0 [TO H3 K0 K10 K4] This is weird all together because you are sending K10 to BFM 0,1,2 and 3 which means enable (k10 = HA = Bin 1010) this enable Ch1 and Ch 3 I think it is a mistake it should be [TO H3 K1 K10 K4] Then it would be 10 sample or ms set for sampling for channel 1,2,3 and 4 Edited by Gambit
1 person likes this

Share this post


Link to post
Share on other sites
right, that was how i was reading it which confused me. i fully understand it now. that one was the spanner in the works that made no sense. i guess in the majority of cases you would just enable all analogue inputs anyway, so you wouldnt have to worry about working out what the hex number is to enable certain channels, you just use H0. thankyou for your help.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0