Jump to content


UniStream & UniLogic Beta
  • Posts

  • Joined

  • Last visited

  • Days Won


Posts posted by Damian

  1. Is there a way to always have a value add to an existing one so that the plc can keep a running total?

    Yes, of course. Just an ADD block where one of the Source and the Destination are the same address.

    The application I'm trying to develop is a fueling one, where everytime they pump product, it adds to the master total and prints a before and after ticket.

    I'm having trouble getting it to add each time without resetting. And I'm not sure how to read a before and after, basically from the same ML.

    You can't read before and after on the same ML. You need to define one as the previous value and one as the current value. Every time you read you need to then shoft the current value into your previous value.

    Where when they select begin fueling it will take the master total as a before and then when they hit end fueling it will take the master total plus the gross.

    To me it would be the other way around. It would be taking the current value minus the previous value to determine the gross of the last fill.

    Do I need to incorporate a DT read/write rows?

    That depends on if you need to keep track of every transaction.

    hopefully this makes a little sense, I took this program over from an former co-worker so there is a lot of things in it that doesn't really make sense to me as I have no training beside a seminar.

    Note: I can get the program to print a ticket and show a before and after with the values but they just reset evertime.

    I might be a bit unclear about exactly what you want. Is it OK to post the program so we can see what you are doing?

  2. It is generally understood no matter whose platform you use that the transitions are based off WHEN in the program that bit of memory gets written resulting in a change of state.

    It is not (should not be) be directly related to the "housekeeping" portion of the scan.

    However, if you are reading physical Inputs, then those are updated only during the "housekeeping" portion of the scan.

    Unless of course you use an immediate IO read to sample the hardware IO before the "housekeeping".

    Since MB bits are internal, there is no housekeeping necessary for them, therefore the end of the scan is irrelevant.

    In addition, if you have conditionally executed subroutines in a PLC (which should normally be avoided for a host of reasons) your code may completely miss transitions that came and went because the transitional instruction you are using will base that off of the evaluation of that instruction the previous time it was exectued.

    On the flip side, you could have the same bit (MB) of memory trigger positive and negative transitions multiple times in one single scan.

  3. Aha, it happended again! Argh!!!!!!!!!!!!!

    Oddly enough I did not even remember this thread.

    I did a search for the error on the fourm and up popped one hit.

    I said hey, look, someone else already had the same problem.

    Then I said hey, that someone else was me.

    Getting old is so much fun.

    Anyhow, the application I was trying to open was in post #8 here


  4. Just about "Undo downlad"? How exactly you expect this to work?

    Download wverwritesthe existing application. This application is lost. In many cases thhis application is protected by password and cannot be uploaded without special premission.

    What exactly Undo needs to do in such case?

    I hope understanding better your idea we can issue some solution...

    I think that is exactly his point. Since download is obviously a non-reversable process, why does it show up as an option under the UNDO?

    Try it yourself. Do a download and then select the download in the UNDO list. If you go back to the undo list it shows that it processed the UNDO? But what did it actually do? It shouldn't do anything. It shouldn't even show up on the list in the first place.

  5. Can we please get a functional chart of the PID process along with the equations involved so that we can better understand what is happening behind the scenes. ALL other PLC/Motion Control manufacturers publish this information so that a clear understanding of the structure can be had.

    The auto tune feature rarely provides satisfactory operation and there was no means given to favor steady state response or step response depending on the needs of the application.

    • Upvote 2
  6. So, Visilogic V9.4 crached on me last week.

    Apparently it crashed very hard because after that I could no longer successfully download from that point forward.



    Rather than battle this one out, I decided it would be easier to simply uninstall and re-install the software.

    So I did.

    At least I though I did?!?

    After the uninstall process I rebooted.

    Then I re-installed the software.

    Then I ran the software.

    And to my suprise, the very first thing it tells me is that Visilogic was not shut down properly last time and that it would perform the recovery.

    Really? How could it have not shut down properly last time, when it had never even ran before?

    And ....... it still opended up my last project from before. How could it have remembered this if it had uninstalled completely?

    Anyhow, after what I thought was a true re-install it continues to give me the same error on downloads.

    I installed the software in another VM clone, with everything else being identical.

    It works in that clone.

    What do I have to do to make certain of a complete uninstall?

  7. Is it possible for you to normalize these values prior to the PLC operating on them?

    What I mean by that is 12000 radians is the same as 5.3992485942. (12000/(2PI) - INT(12000/(2PI))) * 2PI

    If you take the COS of 5.3992485942 in the Unitronics PLC you will get 0.6341115.

    Unfortunately I tried to normalize the value in the PLC first prior to putting in the COS function but the precision of the FLOAT operation required to do this are just as bad.

    If someone can figure out how to normalize your values in the PLC without loosing precision then you should be good.

  8. If all of your V570's in one LAN, you can scan slaves with resolution of up to 60 per second using modbus over UDP. That's mean full survey of 15 controllers will take no more than 1/4 of second

    Here is logical steps:

    1. Configure Modbus in the master as Follow:


    2. Create "Master Call" data table:


    3. Call next slave on some "start" condition and every time previous modbus session completed (modbus "function in progress" = 0)

    4. Prior to call "modbus read registers" load destination IP from "Master Call" table to Slave IP variable (in my example MI914) and increment index of slave to call. Reset index if greater than 15

    This the most simple setup.

    Note, that Unitronics network card does not have an ARP buffer, so every time you call next slave, network card broadcasts ARP request. Running the master at maximum resolution will create significant load on the network. It's OK if network is dedicated to your application, In case if its a common corporate network, your network admin won't be happy from such traffic. This way you can set a delay timer between sessions and adjust the resolution to appropriate level.

    What 3rd party Ethernet based controllers have you used that support Modbus over UDP? I have never seen any that don't require TCP and the socket dance.

  9. I would recommend using 3 sockets total for the Modbus TCPIP and communicating to 5 slaves on each socket.

    Make a sequencer to

    Connect Socket

    Write a block of holding registers

    Wait for Write comple

    Read a block of holding registers

    Wait for Read complete

    Close Socket

    Index pointers to next Slave and repeat

    Wit a V570 expect about a 120ms access cycle per slave for each socket.

    Therefore your total cycle will probably be around 600ms using three sockets.

    If you can live with up to 2 seconds, by all means simplify your code and put them all on one socket. With 15 slaves you will probably be just shy of 2 seconds if you avoid artificial time delays.

    The above suggestions also assume you both send and recieve your data all in one contiguous block of data. If you have to perform multiple read and writes per every socket connect instance then your times will suffer.

    • Upvote 2
  10. I wonder if the auto-zero function is actually causing the drift. I would be curious to see you perform the same experiment without it. This would at least rule out your load cell, which is very unlikely to be the cause of the issue anyhow.

    I have no idea what the algorithm for the zero-tracking function looks like under the hood. But I would expect that it relies on the peaks and valleys you would get from cyclical readings to determine the hypothetical zero point. So having this feature enabled in a static situation might confuse it. And that might be exacerbated if you have any filtering / rounding activated as well.

    One of the biggest challenges load cell amp designers struggle with is temperature stability of the electronics. Many recommend that the load cell amp is powered up and runnning a while to stabilize in temperature prior to taking readings.

    I also notice that in the examples, the zero-tracking function is interlocked with the "LC function is progress" bits. Did you do this as well?

    Also, are you you executing this function with a one-shot, or do you have it executing every scan? I could see where executing it every scan would also have the effect you are experiencing.

    Here is some verbage in the HELP on the zero-tracking.

    Auto Zero Tracking

    When activated, Auto-Zero Tracking zeros the gross weight according to the conditions you set, enabling the module to automatically compensate for small variations at the zero point, such as those caused by a buildup of litter on the scale platform, or by temperature fluctuations near the scale.

    Before Auto-zero Tracking can zero the scale:

    The Motion Band FB must be included in the application.

    The Motion Band must be active.

    The In-Motion bit, Bit 0 of the MI linked to LC Hardware Status Messages in Hardware Configuration, must already have turned OFF, indicating that the scale is steady.

    Once these conditions have been met, Auto-zero zeros the gross weight.

    Notes ♦

    Once Auto-Zero tracking is activated, it stays active until the function is suspended by the application.


    Auto zero tracking will not function in uV/V representation mode.

  11. Just to put some numbers to this to give the OP a sense of timing.

    Using a V570 (fastest CPU) and dedicating connections to a single slave each, I can perform a full read and write cycle to 4 slaves in on average 15ms. That is, I can read and write to all four slaves in under 12.5 to 20ms.

    It peaks out at 20ms and occasionally I might get one 22.5ms cycle hear or there. Not deterministic of course.

    Now as an example, and I decide to multiplex one socket and talk to all four slaves that way you will find that it takes about 100ms to establish the connection. And this is for each slave. Once you are connected you will want to do a read and a write before opening the socket again. Between that and the socket close that adds about another 15ms of overhead.

    So all together you will end up around 450ms for a read write cycle to all slaves by multiplexing. So multiplexing in this example is slower by a factor of about 20 times!

    So, be careful doing it that way. Most of my processess cannot handle that degree of latency.

    They have developed FAST socket Open/Close FBs that are much faster, but they have not officially released them yet.

    It is also possible to create a socket pinwheel, although the code gets quite complex. The theory behind it is you use three sockets or so. While you are talking to slave 1 with Socket 1, you start connecting to Slave 2 with Socket 2, then maybe slave 3 with socket 3, once Slave 1 is finished Socket 1 closes with Slave 1 and then connects with Slave 4 while you're still reading from Slave 2 on the other socket. Then Socket 2 closes and connects to slave 5. Etc. You get the picture. It helps mitigate the time wasted establishing the connection.

    • Upvote 1
  • Create New...