nesccwbi

Array Step Length/DINT Length

5 posts in this topic

I'm working on a project that is made easiest by using a sequencer. The process I have has 51 outputs. I've created the array as the steps that I need but how can each step have more than the standard 32 bits (DINT)? Is it possible to change the length of the DINT so every output is available at everything step?  Thanks. 

 

Sorry if my description is vague I'm still learning some of the terminology. 

Share this post


Link to post
Share on other sites

I've done this very thing for mol sieve dehy beds in the past. I created a User Defined Data Type (under Data then User Defined). I attached mine so you can import it and look at it.

Then create a tag, I'll call mine DehySeq of the TYPE Seq. Once you import what I made or make your own the data type will be available

The tag wii look something like this: DehySeq Seq[32]. I used the last register as a holding register for the current state of the sequence and use MOV DehySeq[0] to DehySeq[1] to load the placeholder. If statements, timers, whatever control the steps. The MOV just "documents" which step your in and what it does

The structure of my UDT is. I changed the sequence from what is attached. Over time I've learned that the more letters there are in a tag the more I have to type. .V is a whole lot shorter than .Value. Also, Instead of DehySeq I would probably use DS so my tag structure would be DS[0].V etc. Time is money and typing sucks...

V type INT

D type STRING

P1 type BOOL

P2 type REAL

V is the step number

D is what the step does The first two are for the HMI <--- EXTREMELY HANDY Don't underestimate how much time is saved by referencing a populated STRING tag in an HMI. If something changes you change the value in one place. You're going to document the tag anyway, at least you should, so why do it in 2 or 3 places. Let the HMI read the string and report what is going on to the operator

P1 and P2 come in handy if you need a bit for triggering within the specific step or a REAL used for a trigger value. Used together you can do stuff like Compare DegF to .P2 and trigger .P1 if true. 

That's really all you need. I also attached a PDF of a very simple sequence

Seq.L5X

DRA Sequence.pdf

Share this post


Link to post
Share on other sites
Quote

D type String

 

I apologize but I'm unfamiliar with how a string works.  It may be something that I've picked up along the way but did not know what it was called.  Could you explain it to me because the string may be what I'm looking for. 

 

Share this post


Link to post
Share on other sites

Apologies for taking so long to reply. I've been traveling.

I use String tags to populate fields in an HMI. I have a UDT for analog values. The first two strings are for the Tag and Description. As an example maybe Analog[0] is a pressure transmitter. The Tag is PT-100 and the Description is Line Pressure. I can point an HMI at Analog[0].S1 and .S2 and retrieve the information for display on the HMI. In a sequence, if you use the last step in the array as a placeholder you can have a string tag for the Step Number and another for what the step does and display that on the HMI by moving the Step string tags to the placeholder string tags and display the placeholder values on the HMI.

If you're the guy writing the program and developing the HMI too string tags will save a lot of typing. 

Share this post


Link to post
Share on other sites
Quote

how can each step have more than the standard 32 bits (DINT)?

I will offer a solution to your original query. If you can understand and implement it, you may then want to add Michael's suggestions for step description/documentation.

  1. Create a UDT called e.g. D64 with a single element called e.g. StepOut as BOOL[64]
  2. Create an array  tag e.g. Step64 of type D64. Dimension the array to cover the number of unique steps in your sequence.
  3. Create a DINT array tag called e.g. SeqStep with dimension to cover the number of steps in your sequence.
  4. Enter the step numbers for the sequence in required order into SeqStep array.
  5. Create program to advance through the SeqStep array and MOV  the stored value to StepIndex (DINT).
  6. either COP Step64[StepIndex]  to a DINT array, length 2 and distribute to I/O
  7. or, use XIC Step64[StepIndex].StepOut[0] OTE some output, and repeat for all bits.

 

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