DirectSoft Project...Help!?

Cybertaz

Member
Join Date
Apr 2006
Location
FL
Posts
46
Hey Everyone,


I'm new around here and I just need some advice. In school we have some PLC training boards that have 13 pushbuttons, 13 lights, and a DirectSoft 205 PLC on it. We use those boards to write programs our professor assigns us.


One of the projects I have to write now is kind of like the old Simon Says game. There's supposed to be a learn mode and a play mode. In learn mode I press the pushbuttons in any random order I want. When I put it in play mode and hit start the lights should stay on for however long I hit the button and in the order I hit the buttons.



So for example if I’m in learn mode and hit X1 for 2 seconds and 5 seconds later I hit X10 for 8 seconds and then put it in play mode and hit start Y1 will come on for 2 seconds, then a 5 second delay, then Y10 will come on for 8 seconds and go off.



Its very easy for me to explain I just have no idea where to start. Is there any functions ya'll could recommend me using?



Thanks,
Cybertaz
 
I would setup a 16 bit word for each segment of the program. Set the bit in the word that was pushed. Then setup a V memory location for the time. Record the expired time of the timer into the V memory location then goto the next segment. For playback I would setup stages for each segment. Write the 16 bit word out to the output module and load the saved time from the V memory location into a timer. When the timer times out goto the next stage.

I have not done this one before, most of the time its traffic lights in school. Take small steps get one thing working then move to the next one. Good luck
 
We'll what i stuck on now is storing the time the button is held down into a V number. I'm using a Retenitive Timer but when i try to load the time out into a V number it won't let me...
Any Ideas?

THANKS for the replies!

Cybertaz
 
Last edited:
For Timer 0, TA0 holds the accumulated value. If you are using a retenitive timer, it will be a double, and you will need to LDD TA0, and OUTD to the variable.
 
How are you trying to "load the time out into a V number"? How does it respond such that you say "it won't let me"? Remember that the current time value for a time is already in a V register. Direcsoft allows you to use a shortcut (called an alias) for this V register. The time for Timer 0 would be TA0. So it's just TA and the timer number. The command to load its value and sen it to some other place would be:

LDD TA0 (for the accumulated value of timer 0)
OUTD V2000

Edit - missed the "retentive" part
 
You may want to look in the Directsoft help files. They should give an example of how to load the value out of TA0 into a V memory location.
 
Ok everyone,

So today in class i finally loaded the timer into a v number. Before i was trying to LD not Load Double (LDD). But now i'm stuck on ways to remeber the order. I kind of figured it out, it just way more rungs than i think it should. Any Ideas?

Thanks again,
Cybertaz126

Ohh and belive me, i've tried asking my professor questions but he just tells me to read my book. He's got to be the worst professor ever. It's hard to know what to look up in the book when you have no idea where to start....:mad:
 
If you want us to look at it then do 'File' - 'Export' - 'Program' to send the program to a text document. Open the document in Notepad. Copy and Paste the program into a post here. Then we can directly load it into Directsoft and look at it. If it gets a little long with all the documentation then you can choose to not export that. Try different ways then choose the one you want to post here.

I can be difficult to keep things straight at first. Imagining the scan process is just like scrolling through the program.
 
Thanks Man,
If i get a change in school tommorow i'll do that. I wish there was some kind of DirectSoft simulation program i could use at home. I have the AllenBradly LogixPro CD and thats excellent to learn on. If only DirectSoft had one...
Thanks Again,
Cybertaz
 
Basicly your recording keystrokes.

In an attempt to use a DL06 as a light controller for a Christmas display, (inspired by the Wizards in Winter show).

So in words here's how it goes....

What you want to do is copy the status of input register (once per second), and store the current value in a Vmem location.

For Recording: In one second increments, LD V40400 (input image), OUT V2000 (user memory), on the next clock cycle increment the value for V2000 to V2001, and on the next clock cycle the image will be stored in V2001...and so on.

For playback: LD V2000, OUT V40500 (output register), INCrement the value in the LD instruction, and on the next clock cycle V2001 will be written to V40500..and so on...

That's not the all of it, but if you post some code, I'll be happy to take it further with you.

Tip 1: read up on Pointers. You will use a pointer to store, then read the user Vmem. Also read up on INC, (incrementing) you will use this to increment your pointer values.

Tip 2: If your assigment is for reading and playing back for 16 seconds or less, read up on Time drive Durm Counters.

Tip 3: Your final program shoud be very short. Maybe less then 100 instructions, which would allow you to write some of it at home by downloading DS5 (trial version) from here:
http://support.automationdirect.com/demos.html

Here's the 205 manual.
http://www.automationdirect.com/static/manuals/d2user/d2user.html

Here's some example programs:
http://support.automationdirect.com/examples.html


Be sure to note the CPU your using.
 
Last edited:
Thanks for the replys! My professor said today that if we don't have this program done and working perfectly we won't graduate (which is only a month away) so i'm gettin kinda nervous about this. He also said that he wants our program to be able to store a max of 100 hits of the button. So it may be a more rungs than i thought, it'll just be repetitive stuff.
Also your saying to use v40400 and v40500. Is that the same as using load formatted(LDF) and out formatted(OUTF) Because isn't v40500 the same as VY0?

I didn't have long to work on it today i just tried to get it all labeled...but here it is if anyone has time to look at it.

PLC 250(-1)
// Rung 1
// Address 0
STR X15
OR C0
ANDN X14
OUT C0
// Rung 2
// Address 4
STR X14
OR C1
ANDN X15
OUT C1
// Rung 3
// Address 8
STR X11
OR C2
ANDN X12
AND C1
OUT C2
// Rung 4
// Address 13
STR C0
AND X0
STR X7
TMRA T0 K0
// Rung 5
// Address 19
STR C0
AND X1
STR X7
TMRA T2 K0
// Rung 6
// Address 25
STR C0
AND X2
STR X7
TMRA T4 K0
// Rung 7
// Address 31
STR C0
AND X3
STR X7
TMRA T6 K0
// Rung 8
// Address 37
STR C0
AND X4
STR X7
TMRA T10 K0
// Rung 9
// Address 43
STR C0
AND X5
STR X7
TMRA T12 K0
// Rung 10
// Address 49
STR C0
AND X6
STR X7
TMRA T14 K0
// Rung 11
// Address 55
STRND X0
AND C0
LDD TA0
OUTD V2000
// Rung 12
// Address 59
STRND X1
AND C0
LDD TA2
OUTD V2002
// Rung 13
// Address 63
STRND X2
AND C0
LDD TA4
OUTD V2004
// Rung 14
// Address 67
STRND X3
AND C0
LDD TA6
OUTD V2006
// Rung 15
// Address 71
STRND X4
AND C0
LDD TA10
OUTD V2010
// Rung 16
// Address 75
STRND X5
AND C0
LDD TA12
OUTD V2012
// Rung 17
// Address 79
STRND X6
AND C0
LDD TA14
OUTD V2014
// Rung 18
// Address 83
END

#BEGIN ELEMENT_DOC
"X0","PushButton1","",""
"X1","PushButton2","",""
"X2","PushButton3","",""
"X3","PushButton4","",""
"X4","PushButton5","",""
"X5","PushButton6","",""
"X6","PushButton7","",""
"X11","Start","",""
"X12","Stop","",""
"X14","Playback","",""
"X15","Teach","",""
"C0","TeachMode","",""
"C1","PlaybackMode","",""
"C2","StartBit","",""
"T0","","","Tells how long X0 was held down."
"T1","","","Tells how long X1 was held down."
"T2","","","Tells how long X1 was held down."
"T3","","","Tells how long X3 was held down."
"T4","","","Tells how long X2 was held down."
"T5","","","Tells how long X5 was held down."
"T6","","","Tells how long X3 was held down."
"T10","","","Tells how long X4 was held down."
"T12","","","Tells how long X5 was held down."
"T14","","","Tells how long X6 was held down."
"TA0","","","Accumulated time of T0"
"TA1","","","Accumulated time of T1"
"TA2","","","Accumulated time of T2"
"TA3","","","Accumulated time of T3"
"TA4","","","Accumulated time of T4"
"TA5","","","Accumulated time of T5"
"TA6","","","Accumulated time of T6"
"TA10","","","Accumulated time of T10"
"TA12","","","Accumulated time of T12"
"TA14","","","Accumulated time of T14"
"V2000","","","Time X0 was held down."
"V2002","","","Time X1 was held down."
"V2004","","","Time X2 was held down."
"V2006","","","Time X3 was held down."
"V2010","","","Time X4 was held down."
"V2012","","","Time X5 was held down."
"V2014","","","Time X6 was held down."
#END

Thank You,
Cybertaz
 
Cybertaz,

You've missed the boat.

To record 100 button pushes that way is going to take a LOT of repetitive code.... You only need one rung to store all the values...

Lets say you want to record all 16 inputs (x0-x17)

Since your using the 250 cpu your recording pointer will be V1400, and your actual recording will start with V10000.

For starters you want to read the input image register and store whatever value is in it at the time to antother discrete memory location. You want to do this one time per second, so you will be using a 1 second clock pulse (sp4) to step your read & write code.

LD VX0, OUT P1400.

V1400 is a pointer. The value in V1400 is the location of the pointer, so the value in v40400 will be written to whatever the Vmem is in V1400. To start recording the vlaue in V1400 will be pointing at V10000.

Then increment your pointer by two locations. (INC V1400). Now the value in V1400 will point to V10001. Now you will be recording the next seconds status, and so on.

A month is a long time. Just read up on POINTERS, and impress your instruction with efficent code.

What your doing here is building a big drum (100 location) recorder.

Questions:

1) How many seconds do you have to record? or is there no limit, just 100 events.

2) Do you have DirectSoft at home? If not download it from the link I provided in my previous post.

3) Do you have the 205 manual? If not download it from the other link I provided in my previous post and read up on...POINTERS, then take a look at the 250-1 Memory map in the back of Chaper 3.
 
Last edited:
Cybertaz,

I've just pounded out part of the code just to see. You should be able to do this in less the 100 instructions, so download the DS5 demo version so you can work in it at home.
 
Thanks ElevMike for your help....

1) There's no limit. He wants the light to stay on for as long as we hold the button and to stay off for the time we wait to hit the next button.
2) I've just downloaded the demo..thanks for the link
3)I have the DL205 PLC User Manual Volume 1 & 2

I've never heard of Pointers until now. And evidently my professor hasn't either because he said this program will be over 1200 rungs and take at least 5 weeks to do.🙃

But i'll read up on them tonight and post my progress tommorow after school and work.

Thanks Again,
Cybertaz
 

Similar Topics

Hi guys, I've been handed project files from a control system I've been asked to investigate, but I'm not certain what controller they are from...
Replies
3
Views
3,967
I am not a Automation Direct programmer. I have done a lot of RS500 I have the DS5 software and I am able to look at the program. I am reaching...
Replies
10
Views
1,192
Hello, I have a couple of problems with the directsoft 6 software. I couldn't find a previous answer, and uninstalling and reinstall hasn't...
Replies
4
Views
1,503
Hello all, We have an old AutomationDirect DL405 (CPU 440) PLC, and we've been using DirectSOFT 5.3. Since we are NOT upgrading this PLC for a few...
Replies
6
Views
2,274
Hey everyone, Working on a system with a Koyo DL06 processor and it's my first experience with them. I have DirectSoft 6 and we got the program...
Replies
5
Views
2,371
Back
Top Bottom