Recording and reproducing signal from Joystick

vinitch

Member
Join Date
Jun 2002
Location
Pune, india
Posts
14
Hello !

I am developing a ladder logic application to record a joystick signal ( 4-20mA) with respect to timeand reproduce it through analog output usin Allen bradley SLC5/04 PLC.

When the operator presses RECORD button , the PLC will start recording the movement of JOYSTICK ( 4-20 mA) untill the operator presses STOP.
When the oprator presses REPRODUCE button ,the JOYSTICK input recorded will be OUT through analog output module exactly inthe same way as recorded.

Does anybody have idea to do this logic in simplest way using Logix500 ?

Matter urgent.

Regards.

Vinit.
 
When you say reproduce it exactly as recorded, how exactly are we talking about? What kind of resolution is acceptable during playback? How long of a recording would be needed? Keep in mind a PLC's memory is limited and the higher the resolution of data recording the faster you are going to use it up.
 
The recording time is maximum 180 seconds.Resolution expected is maximum possible.Just need to save the analog value from joystick in memory with respect to time and OUT the same via analog output module in the same fashion.( the graph of value w.r.to time must be same.)
 
vinitch said:
The recording time is maximum 180 seconds.Resolution expected is maximum possible.Just need to save the analog value from joystick in memory with respect to time and OUT the same via analog output module in the same fashion.( the graph of value w.r.to time must be same.)

Are you attempting to build a "poor-man's" CNC machine? Or is this just a project for personal use? The reason is, as mentioned above, the resolution and number of counts per movement would change drastically....depending on your requirements.

You are not trying to simulate the "Jackel" with Bruce Willis.....are you????? (Servo controlled armor-piercing gun actuated and followed with a joystick)......

Scary.
Is this Halloween or what?
 
Use a FIFO, during record, triggered by a timer. don't forget the FFU when the thing is full. This will give you a file full of data for the most previous time period (180 secs). The timer preset will be your resolution, lets say .1 second--then there will be 1800 data points (FIFO length) for 180 seconds.

During playback, use the same timer .dn bit to increment an index counter, preset to 1800. Theen move the data, one element at a time to your output. move N20:[indexctr.acc], O:1.0. N20:0 will be the oldest, or first recorded data.

Then you have to think about things like--What can go wrong--What if he only records 32 seconds?--Do I need a record done button? And the first step of any record sequence should be to move zero to all the fifo data points. This erases the previous record event.

I actually, last week, did something similar in a logix 5000 controller to constantly collect machine data to be played back to a trend chart in the case of a fault.
The fifo is always running. When the fault occurs, the fifo array is copied to a playback array and "played back" to the screen--over and over. I get the latest 5 minutes of data immediately preceeding the latest fault to review at my leisure. Even put a data entry object there to set the playback pointer to go to whatever position I want.
 
Last edited:
Very Cool John. This seems to be a great thing to integrate. How much memory does a 1800 point FIFO Stack consume BTW? (These are words, not bits) Also, what about the unloading of the stack, FIFU memory?
I know that Clogix has the overhead...but a 5/04? Even with 64K of MAX memory.....is this feasable?
 
is this just single axis joystick (only up-down or only left-right)?
0.1second may be too slow. also accuracy will depend not just
on sampling interval but also on accuracy of sampling interval
(scan time varies).
as for code, personally i would rather use indirect addressing
but that's matter of taste (i find FFL/FFU rather limiting).
cross file boundaries can be solved in different ways, even
using indexed addressing if accross files indexing is enabled.
 
If he is recording the movement commanded by the joystick ... then its the output of the PLC he needs to record not the input of the joystick.

Joystick can have variable signals but the operator adapts to it with his naked eyes looking at the thing moving... Outputs Sir, not input.

My 2 cents.
 
I'm assuming that the device performing the end movement is not the PLC. He just wants the PLC to be a recording device and then, on PLAYBACK, become an emulator for the joystick into whatever device the joystick is controlling.

I would hook up the PLC as ALWAYS connected to the end device. In normal mode just have it be a pass-through of the dignal with possibly RECORDING being done. Then, in PLAYBACK, the internally stored measurements of either the joystick inputs or the replicated outputs (it's the same effect in either case), are the source.

As others have pointed out, the output to the end device in the normal mode whould be in discrete units of time, that being the scan time of the PLC. This digitizing of time may or may not have any noticable effect.

In PLAYBACK mode the output would be in the units of the time interval you chose for the recording. If you stored an image EVERY scan then two actions (during normal/recording and playback) would be the same but it would use memory awfully fast. The selection of the units of time for the recording will be a tradeoff between "end unit performance" and "memory usage/recording time".
 
Thanks everybody for the quick replies.

John,yesterday I tried the same logic you explained with FFL using a timer & a counter.It worked.I will try again using FIFO ( FFL & FFU) & let you know.

Regards.

Vinit.
 
How much memory does a 1800 point FIFO Stack consume BTW? (These are words, not bits) Also, what about the unloading of the stack, FIFU memory?
I know that Clogix has the overhead...but a 5/04? Even with 64K of MAX memory.....is this feasable?

1800 words--3600 Bytes. It they are integers--double that if they are reals, or floats.
 

Similar Topics

I have to rollout a common CLX PLC program to a dozen or more installations, but each installation uses a different HMI front end. Some WW, some...
Replies
8
Views
881
Dear all I need help for delta plc programming . I can use DVP-12SE PLC and HMI DOP-B10E615 as they both support ethernet. I am planning to make...
Replies
0
Views
1,514
Good Afternoon, Many times I will quickly brainstorm an idea on FactoryTalk View , and would like to email it a coworkers , instead of...
Replies
14
Views
3,485
There has been a request for me to setup one of our machine HMI's to record a change in a setpoint. It needs to show what the last setpoint was...
Replies
4
Views
1,737
Hello, I am looking for advice on the best way to log production. The equipment is Allen Bradley SLC 5/04 and C More Ea7 touch panel. The managers...
Replies
11
Views
2,545
Back
Top Bottom