Sign in to follow this  
Followers 0
JDHammond

Q series Anolog In/Out

40 posts in this topic

Right now we are running a brake setup that uses P/E's to see a roll diameter and depending on what P/E is blocked were are using a pot going to a brake amplifier that sends 24VDC to the brake. I am looking into installing a sensor that will give me a 0-10 VDC analog to the PLC and I need to scale the 0-10 VDC from the sensor to a 0-8 VDC out to the brake amplifier. What fuction would I use do this? Thanks

Share this post


Link to post
Share on other sites
There is no scale command, so I would use simple math. 0-10VDC typically is 0-4000 or 0-12000 in the Q. Convert it to floating point, multiply it by 0.8, then convert it back to integer to send to your analog output.

Share this post


Link to post
Share on other sites
I finally received the Q64AD card and I can not get the programming set up. It is on a Q06H it is in the fourth slot in the rack. I only want to read the first channel on the card. I keep getting a error (2110) The I/O number designated by n1 is not for the intelligent function module. In PLC parameters and the I/0 assignment I have the 4rd slot as a inteligent 16 bit. Do i put anything in the Start XY slot. Then under switch setting what do i put under switch 1-5? Can someone point me in the right direction with this and a simple programming example. I have looked through the post on here and read them and looked in the Q instruction manual on the TO/FROM instuctions and cant get anything from it. Thanks for your help!

Share this post


Link to post
Share on other sites
The addresses for the instructions depend on what modules are before it on the PLC rack. Q uses free addressing, so each module takes the number of points it needs. Tell us you whole rack layout and we can help you with the addressing. SH(NA)080483 system design SH(NA)080484 program fundamentals or just search Q06H in part number lookup.

Share this post


Link to post
Share on other sites
I/Os are mapped to X(inputs) and Y(outputs). each card maps certain amount of I/O so addresses used by next card begin after last address of card before it. let's say you have some cards arranged like this: CPU 16x digital input 32x digital input 32x digital input 16x digital input 32x digital output 32x digital output special card (like analog input) the first card starts at 0 and since addresses are hex, those inputs are 0000h-000Fh (0-15dec). the next card starts after that (32 points total or 20h) will use 0010h-002Fh etc. CPU 16x digital input (0000-000F) 32x digital input (0010-002F) 32x digital input (0030-004F) 16x digital input (0050-005F) 32x digital output (0060-007F) 32x digital output (0080-009F) any other card (starts at 00A0...) Note that digital inputs will be mapped to X, outputs to Y so all digital inputs in this example will be in range X000-X005F and all digital outputs in range Y0060-Y009F. if one card is special (any card other than digital input or digital output is special) then it will occupy both inputs and outputs. for example if your analog card maps 16 points that would be both 16 inputs and 16 outputs (X00A0-X00AF, Y00A0-Y00AF). Note in the manuals they always assume that card is in first slot and addresses are starting at zero. This means that if you want to use examples from manuals, you have to offset those addresses. if the manual for analog card mentiones Y5 for example, you would have to use Y00A5 instead (add start address of the card which is 00A0h). Note that addresses so far were talking about BITS. If you remove last digit of the start address you would get head address (which is used in TO/FROM instructions). For example if the last card in this example was analog, then start address is 00A0h (bit level), then head address is simply 00Ah (word level, just remove last digit of the start address). just ask if you run into trouble... btw. there is also a way to manually assign mapped addresses to individual (or all) cards regardless of their order in the rack but most people prefer to use 'natural' assignment described above.

Share this post


Link to post
Share on other sites
1st slot Q06HCPU 2nd slot QX42 3rd slot QY22 4rd slot QJ61BT11N (CC Link Card) 5th slot Q64AD (Analog In 4 Channel) 6th slot Q64DAN (Analog Out 4 Channel) Edited by JDHammond

Share this post


Link to post
Share on other sites
From this information what would a typical TO/FROM statement look like. What exactly does the TO and FROM do? Do I designate where the analog in signal is stored? Example D10?

Share this post


Link to post
Share on other sites
In the analogue input card are things called buffer memories. The buffer memories store information such as the set up data for the various channels, the current values of the channels etc. The CPU communicates with these buffer memories to extract the information that you need, eg the value of the analogue inputs. The TO command writes information from the programme to the buffer memories and the FROM command reads information from the buffer memories into the programme. Sometimes you will see the TOP command which is the same as a TO command, but the P indicates that it is a "pulsed" TO command, meaning that it only happens for one cycle scan when the rung conditions are true. I haven't used the Q series CPUs yet, so it may be different, but I posted an example of a QnA analogue input card in the thread below, which is pretty self explanatory http://forums.mrplc.com/index.php?showtopic=7677 The key thing is that the CPU needs to know what address to read the data from, and this is determined by the BASE Address of the analogue input card and the buffer memory of the analogue input card. Note that the Base Address of a card is the first two digits of the Hex address. Therefore a card with the Hex address 160 is entered as 16 on the FROM and TO commands. The example posted is from IEC Developer, but the same rules apply with GX Developer

Share this post


Link to post
Share on other sites
Try the attached *untested* function block. I'm not using TO/FROM as MOV uses less memory. (Not that you'll run out on a Q006H, moan, if only I could get my hands on one of those, grumble, shouldn't be allowed, moan...) The program is setup for 1 channel 0-10V Head address H5, input start H50 which might just work. If you use it let me know if it works! Edit : I forgot to program the error bit, we can add that later. Q64AD.zip Edited by Veganic

Share this post


Link to post
Share on other sites
I found that the head address is H4 so i used [TO H5 K0 H0 K1] So the H5 is the head address, K0 is where its written, H0 where it is stored, and K1 is how many words. [FROM H5 K11 D100 K1] H5 is head address, Ho is data to be read, D100 is where it is stored, and K1 words to be read. So on the TO statement does the H0 store the analog signal and the H0 in the FROM statement put it in D100? Im guessing the H0 is the buffer memory? __rogram.doc

Share this post


Link to post
Share on other sites
Oops, yes H4 is correct, I counted from 1 instead of zero. [TO H5 K0 H0 K1] H5 is the head address. K0 is where it is stored in H5. H0 is the value that is stored. K1 is the how many words. [FROM H5 K11 D100 K1] H5 head address K11 is where the data to be read is read from. D100 is where it is written. K1 is the length.

Share this post


Link to post
Share on other sites
If H0 is the value to be stored, is that a constant or is that the reading from the analog sensor im using? Also the TO is storing it in H0, should the FROM be reading it from H0 instead of K11? Thanks

Share this post


Link to post
Share on other sites
I did a detailed module information and it said my start address for my module is 70. I programed my module ready and a/d conversion complete also. I still can not get any thing into d100? I went to the buffer memory batch and I can watch my analog signal go up and down in 000b. I compared it to another program we have off of a similar machine. I just cant get whats in the buffer memory into d100? Edited by JDHammond

Share this post


Link to post
Share on other sites
The only think I see that may be causing a problem is under the detailed module information I click on the Q64AD module and at the bottom right it has H/W Information, under that it says my Switch setting for switch one is 4000, which would mean Ch 4 -10 to 10 V. I have my switch settings in PLC parameters set at 0005 meaning Ch 1 and 0-10 V. Could this be the problem. I compared it to my other processor and they were the same on it. I tried to write it to the PLC and selected PLC parameters when I downloaded but it didnt change?

Share this post


Link to post
Share on other sites
So in a batch read you can see the analogue value rise and fall? Is the address U7\G11 (11 decimal = 0B hex, as in K11 for the From statement). Forget the FROM statement, Try ...-[MOV U7\G11 D100]- Also try somewhere other than D100 incase the problem is there.

Share this post


Link to post
Share on other sites
Yes it 11 dec. I tried the mov but it wouldnt accept it?

Share this post


Link to post
Share on other sites
I had the backslash the wrong way. I really appreciate everyones help!!! I have a better understanding of the buffer memory and the A/D card. Well tommorow I will start on the output card but hopefully wont need much help due to what I have learned from the Analog In card. Thanks Again!!!!!!!

Share this post


Link to post
Share on other sites
Started on my Q64DAN Output card today. The card is in the next slot past the analog IN. I used the MOV u7\G11 to get my analog in into a data file. How do I take that and send it to my analog out card for CH 1. The Slot address is 80 so i used my X80 as my module ready and so on so on. Do I use a MOV to send it back to the Analog OUT? Thanks

Share this post


Link to post
Share on other sites
I used the MOV and sent D100 to U8\G1 which is CH1 digital value. Should my card be showing that as a voltage out now?

Share this post


Link to post
Share on other sites
not just yet, there are few more things to be done. for example you need to enable channel output(s) by setting Yn1...Yn4 (they would be Y81...Y84 in your case) and enable DA conversion (this works per channel so MOV hF Un\G0 enables conversion all four or MOV h1 Un\G0 for just one channel). reason for per channel conversion enable is that you can get faster conversion if you disable unused channels.

Share this post


Link to post
Share on other sites
ok I got all that allready, I added the MOV h1 u8\g0 and still nothing out of ch1.

Share this post


Link to post
Share on other sites
1. Switch setting: Rising edge on X0 or X80 or whatever -|^|- ----[Mov H4 U8\G0] H4 sets ch1 to -10 to +10V At the same time set Y9 or Y89 or whatever ----[set Y89] This request that the settings be changed. 2. Wait for conditions to be accepted: X80.Y89.X89 -| |--| |--|/|---------[Rst Y89] 3. When ready to output data then turn Y1 or Y81 on ------ (Y81) This enables Channel 1 4 Output the data ---------[Mov D100 U8\G1] It's all in the manual. Edit : don't believe everything I've typed in this post! Edited by Veganic

Share this post


Link to post
Share on other sites
That is what i have had and still nothing out of CH1. I will try again tommorow. Thanks for you help.

Share this post


Link to post
Share on other sites
If the analogue input is H7 and it's a 32 bit unit then the next one along, the analogue output, will be H9.

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