Shop OBEX P1 Docs P2 Docs Learn Events
has somebody worked with PicoPLC? — Parallax Forums

has somebody worked with PicoPLC?

StefanL38StefanL38 Posts: 2,292
edited 2013-07-04 23:47 in General Discussion
Hi,

has somebody worked already with PicoPLC from Attila Kolinger?

see this thread: http://forums.parallax.com/showthread.php?121404-PICoPLC-Free-DIY-PLC-with-Propeller

There is some documentation. But I still find it hard to understand. What I would need is a diagramm and description
of a simple automated process like

There are the switches S1 and S2 if both are pressed at the same time output A2 will be turned on for three seconds ... etc.
and the related ladder-logic for this example.

Even better if there would be an example for each ladder-element.

Otherways I have would have to do try and error with each and every combination trying to understand what the ladder is doing.

best regards
Stefan

Comments

  • StefanL38StefanL38 Posts: 2,292
    edited 2012-12-17 08:40
    OK as nobody has answered yet. I started playing around with picoPLC to find out how it works by tral and error.
    I understand a few first things. If my knowledge will grow is anybody interested in explained examples?

    If yes drop a short answer.

    best regards
    Stefan
  • Duane C. JohnsonDuane C. Johnson Posts: 955
    edited 2012-12-17 11:19
    Please continue as I am interested in your experiences.
    No, I haven't tried PicoPLC but it intrigued me.

    Thanks!
    Duane J
  • skylightskylight Posts: 1,915
    edited 2012-12-17 13:20
    You get a 404 when you use the links in the linked thread, have you working links?
    I have experience with programming other PLC's such as Siemens and maybe could help once i've played with picoPLC

    For your example you would put two inputs in series with a timer and an internal relay then use that relay in series with an output

    Not knowing the program I can't help yet with what settings , labels, inputs,outputs ,timers etc
  • JordanCClarkJordanCClark Posts: 198
    edited 2012-12-17 13:29
    skylight wrote: »
    You get a 404 when you use the links in the linked thread, have you working links?
    I have experience with programming other PLC's such as Siemens and maybe could help once i've played with picoPLC

    For your example you would put two inputs in series with a timer and then in series with an output

    Not knowing the program I can't help yet with what settings , labels, inputs,outputs ,timers etc

    Ditto.
  • StefanL38StefanL38 Posts: 2,292
    edited 2012-12-17 14:00
    Hi,

    I try to attach a zipfile to this posting ...

    seems to work.

    I found out some basic things myself. And-function is clear. How would you design a "self-keeping-switch"?
    best regards
    Stefan
  • skylightskylight Posts: 1,915
    edited 2012-12-17 15:05
    Ok just had a quick play with it and attached are a text file and a picoplc file(had to give it a txt extension to upload it, just change the .txt bit back to .picoplc on the one with program in the title),
    hope that's what you intended to happen
    regards
    skylight

    S1&s2 timed output.txt
    S1&2 timed outputprogram.txt

    edit actually i've just re-read your original post and it wasn't a 3 second delay you wanted but an output for 3 seconds, i'll re-do the files and attach them later, sorry about that.
  • skylightskylight Posts: 1,915
    edited 2012-12-17 15:33
    Here are the revised attachments(rename the program one's extension as before) the timer works with momentary push buttons, in the simulation you will need to release at least one or both pushes by double clicking again to simulate releasing the pushes for the timer to start timing (also you could play with the one shot instructions ie add a one shot rising instruction after the second input S2 this will allow the timer to work regardless of whether the pushes are still made or not) .

    Also attached is the compiled Spin file for the one shot circuit, although I have to say I havn't tested it, perhaps someone could? It uses pins 1(PA0) and 2 (PA1) for inputs and pin 3 (PA2) for output

    S1&2 timed outputprogram revised.txt
    S1&s2 timed outputrevised.txt
    S1 &S2 timed output with one shot.txt
    S1 &S2 timed output with one shot.spin
  • JordanCClarkJordanCClark Posts: 198
    edited 2012-12-18 04:15
    Variations of a theme. Just shows more than one way to do a task.

    Also, Did you want an example of a toggle? Added that one, as well...
  • skylightskylight Posts: 1,915
    edited 2012-12-18 04:51
    The program works with the Dip version of propeller I have the quickstart board and i'm trying to tally up the pins accordingly but not being able to find out a comparison in the documentation, does anyone know the pin for pin between the Dip and quickstart ie what pin(s) would I select to run the leds (pins 16-23 on quickstart)
  • JordanCClarkJordanCClark Posts: 198
    edited 2012-12-18 05:12
    Looking over the compiled spin code, it seems straight forward. It compiles to the port (PA0, PA1, etc.), not the pin.:cool:

    In fact, I was just starting to dig out my Quickstart when I saw your post! Great minds and all that...
  • skylightskylight Posts: 1,915
    edited 2012-12-18 06:34
    Thanks Jordan I am a beginner with the prop and not sure how you would link the port to the pin as such so as to light a quickstart led, had any luck?


    I'm going to post in the propeller forum a compiled spin file and see if anyone has any ideas
  • StefanL38StefanL38 Posts: 2,292
    edited 2012-12-18 09:25
    Hi everyone,

    thank you very much for all the example files! Have to go through them.
    I made progress myself in understanding ladder-logic.
    I found to bugs in the spin-code:

    The autoerated spin-code from picoPLC produces a wrong textline for the chrystal setup.
    The direction register DIRA for outputs are not setup properly

    The outcommented lines are the wrong ones generated by picoPLC.
    I have already sended an Email to the author of picoPLC. He answered me that he will send me
    the newest version of picoPLC in a few days. Have to ask if I'mallowed to upload it here.
    (He's busy with his daily work for making money.)

    CON 
    _XINFREQ = 5000000 'Hz 
    'instead of 
    '_CLKFREQ = 5000000 'Hz 
     _CLKMODE = XTAL1 + PLL16X 
    CycleTime = 100 '1/sec 
    
    PRI PlcCycle | timing 
      DIRA[U_Y2] := 1 
      DIRA[U_Ynews] := 1 
    'instead of 
    '  DIRA := $00000000 
    '  DIRB := $00000000 
    

    @skylight: The IO-Pin-numbers of the quickstart-board are the same as with the DIP-version.
    picoPLC and spin uses the logical pin-numbers. There are IO-pins numbered from 0 to 31

    Edit: the autogenerated code produces the codelines
    DIRA := $00000000
    DIRB := $00000000

    which set ALL IO-Pins as input.
    So you ave to look up the code manually how Outputs are named and you have to insert
    new lines of code
      DirA[NameOfOutput] := 1  'set up IO-pin as Output by setting DirA-bit to 1
    

    The hardware-pin-numbers of the housing may differ but the logical pin-numbers are always the same
    for each propeller-chip and each propeller-board.

    try these corrections and post the results here.

    best regards
    Stefan
  • skylightskylight Posts: 1,915
    edited 2012-12-18 23:28
    I'm at work now but will try the alterations as soon as I can, thanks for the help Stefan
    You may also be interested in a thread I have started in the Propellor forum regarding this program?
  • Devin FrioudDevin Frioud Posts: 17
    edited 2013-07-04 22:27
    Hey people!

    I was wondering where I could get the required software, as the links show a 404 page not found.

    Thanks,
    Devin
  • NWCCTVNWCCTV Posts: 3,629
    edited 2013-07-04 23:47
Sign In or Register to comment.