Jump to content

Isakovic

Privileged Member
  • Posts

    192
  • Joined

  • Last visited

  • Days Won

    13

Posts posted by Isakovic

  1. You set up encoder in "Hardware configuration". There you select for high speed inputs "shaft encoder" x2 or x4 and assign memory location to it (use ML or DW instead of MI because it has bigger range). Note that if you select x2 you will have a value of 200 for full turn, and if you select x4 you will have a value of 400 per turn. It will also increment in one and decrement in other direction.

    All other logic you will have to work out in ladder. How many impulses per mm, presets...

    All the best,

    • Like 1
  2. I couldn't find any reset coil elements for timers in ladder. Are you resetting it by not calling a subroutine?

    Someone correct me if I'm wrong, but I think that nets in subroutines won't get updated if subroutine is not called (so bits that were 1 when program last time passed through subroutine will remain 1). I find this not intuitive so I usually run through all routines from main and use bits as conditions. Maybe your program will work if you used reset coil for timer.

  3. - Make a new Variable with that MI in it.

    - Select part of the screen where you want this MI to be displayed, then right click -> Attach Variable

    - Input will activate whenever you navigate to that screen. If you want to have input only when you press a certain key (usually enter), you'll need to make a logic that will set SB39 each time you open a new screen, and reload a screen when enter (or whichever key) is pressed. I think there's a topic about this in forum somewhere, maybe even in examples in U90.

  4. Hello Aus,

    I also set SB168 at power up, I tried messing with system bits but that didn't work.

    What I found to work is next sequence:

    - Init Socket 3 to TCP master (port as before 20259)
    - Delay 2 seconds
    - TCP connect on Socket 3 to timekeeper Server on port 123
    - Delay 2 seconds
    - Init Socket 3 to UDP, port 123
    - Delay 2 seconds
    - Whole update sequence
    - After 1 minute Init block to restore Socket 3 to original settings

    I don't know why it works, but it works. Hope this helps someone.

  5. This is what I found:

    It will work normally as long as no TCP connections take place on Socket 3, like accessing from VisiLogic or Remote Operator. As soon as PC connects at least once it will not work until PLC restarts. It doesn't matter if PC-PLC connection disconnects normally or it is violently broken.

    I don't know how to clear  whatever PLC set in its memory. I tried closing the socket and then initializing it to other TCP and even this Modbus workaround Javier did but it doesn't work.

  6. Hello,

    I'll revive this topic because I ran into a similar problem and seek advice.

    Does anyone know what are the codes for socket states?

    I also have to reuse a socket but protocol remain the same (0=PC applincation). Socket 3 at the beginning is TCP / Port 20259 / Server, then, at 4 o'clock every night, initialized to UDP / Port 123 to update the time and after that reinitialized back to TCP.
    It works fine for the first time (after PLC restart), but every try after is unsuccessful. Socket 3 state is 34 and there's no explanation in help files about socket states that I could find. When RFC function runs, Tx counter increments by 1, Rx remains the same for Socket 3.

    Other controllers that have UDP port dedicated for this purpose (no init block after startup) don't experience this problem.

    I'll fiddle with troubleshooting some more to find a workaround if possible in the meantime.

    Update time.PNG

  7. I tried breaking NET 86 into several smaller ones and making it simpler, It couldn't been done in one NET anyway. It's always better to have simpler nets, I learned it the hard way.

    I don't have much free time now to work out the logic of the whole thing (like when should T1 start counting), you'll have to test if this is what you were looking for. I'd also suggest breaking programs into smaller subroutines, so you'll have Main routine (with optionally couple of nets for config blocks) calling other subroutines. Much less scrolling.

    Also, I see you went with SB15. Tell us how it works, and what precision you got.

    All the best,

    59c0a61fb1bec_Sheetfolder.vlp

  8. Well, you could put SB15 (transition contact for 100ms pulse) and input in series and use it to increment a counter. When input goes low multiply counter value by 10 (because timer value is in units of 0.01s) and store the result in timer via "Store Timer" function block (under "Store" tab).

    I'm not sure about precision you can get from this. It may work ok for your application or it may be way off.  As Visco said encoder is the best solution.

×
×
  • Create New...