
adccommunitymod (AutomationDirect) asked a question.
Created Date: March 20,2019
Created By: Fullauto2009
**** This post has been imported from our legacy forum. Information in this post may be outdated and links contained in the post may no longer work.****
Im working on a basic application that will interface with Labview. Im still pretty new to PLCs Basically the TMRA to my understanding counts in .1s increments, thus a value of 10 = 1s. I have set the Timers target value via a memory address (V1200). My problem is that if I input say 100, which should get me a time of 10s before completion results in ~6.7s. I am running 3 timers so far. Each of which I use to fire an output for a user defined amount of time via labview. Initially I had each timer value stored in V1200, 1201 & 1202, after some reading it was suggested to move the memory locations. Now the timer values are at V1200, 1202 & 1204. I write the values say 100, 20, and 50. I check the values in direct soft, they match. Dec 100, 20 & 50. So my inputs are being correctly addressed and the decimal values seem to be interpreted correctly. Further, if I watch the accumulator values at V0, 1 & 2 they accumulate and stop appropriately. Using either a stopwatch or labview to count a minute (Input to the memory location of 600) for example results in an actual time of ~25s. Its an old PLC, is there a battery or something that needs to be changed? I have attached the program summary file. Summary: The programs starts and stops via C0 & C1. Each timer enables a corresponding output for the user defined amount of time. The program progresses through each of 3 timer/output pairs a total of 3 times. End program. There has to be something simple I'm missing. Thanks.
Created Date: March 20,2019
Created by: Fullauto2009
Im working on a basic application that will interface with Labview. Im still pretty new to PLCs
Basically the TMRA to my understanding counts in .1s increments, thus a value of 10 = 1s.
I have set the Timers target value via a memory address (V1200).
My problem is that if I input say 100, which should get me a time of 10s before completion results in ~6.7s.
I am running 3 timers so far. Each of which I use to fire an output for a user defined amount of time via labview.
Initially I had each timer value stored in V1200, 1201 & 1202, after some reading it was suggested to move the memory locations.
Now the timer values are at V1200, 1202 & 1204.
I write the values say 100, 20, and 50. I check the values in direct soft, they match. Dec 100, 20 & 50. So my inputs are being correctly addressed and the decimal values seem to be interpreted correctly.
Further, if I watch the accumulator values at V0, 1 & 2 they accumulate and stop appropriately.
Using either a stopwatch or labview to count a minute (Input to the memory location of 600) for example results in an actual time of ~25s.
Its an old PLC, is there a battery or something that needs to be changed?
I have attached the program summary file.
Summary:
The programs starts and stops via C0 & C1. Each timer enables a corresponding output for the user defined amount of time.
The program progresses through each of 3 timer/output pairs a total of 3 times.
End program.
There has to be something simple I'm missing.
Thanks.
Created Date: March 20,2019
Created by: Fullauto2009
I suppose I can just write directly to coils to control outputs from labview. Problem more or less solved. Id still like to know whats going on with the timer though.
Created Date: March 20,2019
Created by: Do-more PE
TMRA uses two memory addresses; IE T0 & T1.
Update: Incorrect. TMRAF uses two memory addresses, TMRA only uses one. Too much programming in Do-more where you don't have to worry about such things.
Created Date: March 20,2019
Created by: Fullauto2009
TMRA uses two memory addresses; IE T0 & T1
Sorry could you elaborate? Ive only referenced a memory location for the setpoint in the PLC. IE:. Name: T0 Value: V1200 instead of Kaaaa.
They seem to work ok. I can change the value and it operates longer or shorter depending on value. My problem is that entering say 100 into V1200 doesnt result in a 10s timer.
Am I supposed to specify two locations in the TMRA Box? I didnt see that in the manual?
Not sure how your reply applies to that?
Thanks.
Created Date: March 20,2019
Created by: bcarlton
Remember that in the DL line timer presets and accumulators must be in BCD. Verify that you have that. Your 'dEC ' seems to imply you are in 'binary ' (as DL likes to refer to it). If using a dataview make sure it is showing the values as BCD/HEX. If inputting from an HMI make sure its tags are set to BCD.
Created Date: March 20,2019
Created by: Tinker
Remember that in the DL line timer presets and accumulators must be in BCD. Verify that you have that. Your 'dEC ' seems to imply you are in 'binary ' (as DL likes to refer to it). If using a dataview make sure it is showing the values as BCD/HEX. If inputting from an HMI make sure its tags are set to BCD.
OP Wrote "interfacing with Labview "
I haven't used Labview enough to know for sure if Labview has built in BCD conversion functions (though I'd be surprised if it did not) if not I don't suppose it would be all that hard to write your own.
A quick Google seems to show it is not "built in " but NI does give an example of how to do it: https://forums.ni.com/t5/Example-Programs/Integer-to-Binary-Coded-Decimal-using-LabVIEW/ta-p/3529182
Personally I'd scrap the 05 and buy a BRX (or a CLICK if I was really on a budget) before going through that.
Created Date: March 20,2019
Created by: bcarlton
You could also easily write the conversions(BIN and BCD) in the ladder. Target the Labview to two other double registers for each timer, one for the preset and one for the accumulated value. For the preset it would be LDD NewDoubleWordDecimalPreset - BCD - OUTD V1200. For the accumulated value it would be LDD V0 - BIN - OUTD NewDoubleWordDecimalAccumulator. You would have two conversions for each timer. Note the LDD and OUTD instructions for handling double word values.
Note that you must change your TMRA timers to T0, T2 and T4. Your first timer should be T0 which because it is a TMRA also uses the memory space for T1. Your second timer would be T2 which also uses T3's space. Its preset you have established as V1202/V1203. Its accumulated value starts at V2 (if you use aliases it would be TA2). Finally the third timer is T4 which also uses T5's space. Its preset you have set as V1204/1205 and its accumulated value starts at V4 (or TA4 in alias form).
Created Date: March 21,2019
Created by: bcarlton
I have taken the liberty of modifying your supplied program with my suggestions. I used the area starting at V1300 for the decimal versions of the presets and accumulators. I added the BCD/BIN conversion rungs.
Created Date: March 21,2019
Created by: Fullauto2009
Thanks all. I will review the suggestions and solutions provided.
I appreciate your efforts.
I was slightly lost for a moment.. because Ive seen many posts from bcarlton on several forums about BCD input. Im thinking to myself, An unsigned integer shouldddddd be ok? After all I can convert that into a boolean array and show that its correct ie:. Decimal 24 = 00011000 but BCD would be 0010 0100
Ahhh I see now.
I will reply when I have implemented a solution.
Created Date: March 22,2019
Created by: bcarlton
Here a revision of my suggested program. I had forgotten the references to the timer contacts and accumulators in the inline code.