Jump to content

kratmel

MVP 2023
  • Posts

    1,140
  • Joined

  • Last visited

  • Days Won

    51

Posts posted by kratmel

  1. 2 hours ago, viscoelastic said:

    there is any reasons not to do it that way?

    In my opinion, this is the most accurate method of all possible in the PLC.

    This is because a hardware pulse counter and a hardware timer are used to obtain the resulting frequency. All other methods using ladder code, timers and even interrupts have an error related to program execution time.

    That's why I use this method and recommend it to you.

    • Thanks 1
  2. 1 hour ago, Flex727 said:

    I don't think it would detectibly reduce energy requirements.

    Test result on table with V130-33-TA24. No input and output active. Backlight =100%

    Downloaded blank project and no info on display ------ PS +24V Ips=76.8mA

    Downloaded real project with 10 subrouting and floating point calculation, no info on display   ------ PS +24V Ips=92.3mA

    Reduce backlight from 100% to 0 %  = approx -13mA in both tested project.

    Then downloaded code add approx 0.36W of consumption.

     

  3. 8 hours ago, Ausman said:

    "save the plc doing unnecessary stuff"

    This is a general trend towards energy saving. By turning off the extra light bulb, we are sure that somewhere it becomes easier for the electric generator and less emissions are released into the air :)

    Probably simplifying the code to the required minimum, we unexpectedly do something similar :rolleyes:

  4. So I will try to describe in words the algorithm for solving your problem, which in my opinion should work.

    Therefore, the first power-up of the PLC prompts the user to determine the start date of the weekly reports (it can be  started in setup).

    After selecting the date and time, the user says OK.

    Further from this date, the PLC builds a Data Table of UTC-generated weekly readings (add 24*7*3600=604800s for the next week start) for the required max operating time. (After this max time log is stopped and user must define new period).

    After that, we compare >= the RTC to UTC with the next Data Table week start UTC countdown and set START Pulse for the log file create and start update week events if needed.

    At the same time START Pulse  increment a row of the Data Table, rewrite to UTC variable the following consecutive next week countdown and PLC wait for it (Then START Pulse is disabled) .

    When you turn off and on the PLC, for example, in three weeks later PLC will have generated  three empty files and wait for the beginning of the next working week and start  append some info to the last created file.

    It may not be a perfect solution, but it is not afraid to turn off the PLC because it works on the condition that it is between fixed UTC readings compared with RTC.

    I will try to ladderize it on the weekend.:)

     

  5. 9 hours ago, Ausman said:

    So Joe's state machine is Ladderart, eh?

    State machines were probably known before the invention of the PLC. Thanks to Joe, this work of programming art has become a good tool for solving many typical PLC programming problems.

    At the same time, I think that an example of LadderArt is a piece of code presented by Joe in this topic

     

    It doesn't matter who the author of this code is. Its simplicity, self-sufficiency and usefulness for forum users are important.

    Flex formulated a good task, it interested me and probably many users of the forum. Apparently, the solution to this problem can also become a work of art, regardless of who finds this solution.

  6. Analyzing your proposed new terms, I will try to logically continue the idea and add a new term - Ladderart.

    Small tree (ladderrise) - should be cared for and watered.

    Mature tree  (ladderage) -  self-sufficient and fruitful.

    A product of art made of wood (ladderart) is something that will not change for a long time and will benefit everyone who looks at it.

    Probably a little too much philosophy ... But here on the forum I have already met many examples of compact, balanced and self-sufficient code in the Ladder language - Ladderart.

    Please correct me if I do not understand modern terminology enough.

  7. 3 hours ago, Ausman said:

    Ladderise (Ausman TM)

    An interesting idea of a new word, and as always in mind games, the word means that we visually represent the text of the PLC program from top to bottom.

    Did I understand correctly what it means - to program in the ladder language or to turn thoughts into a ladder?

    But I like it.

  8. 1 hour ago, Flex727 said:

    The positive transition contact would create the .csv file along with a header row in the file. Subsequent data during the week will be added to the file.

    Accordingly, if you specify the week number in the year, the file will appear when the week number is changed. That is, the week number can be used to identify two or more consecutive weeks, even if the PLC does not turn on for a week, a month or more.

  9. Please clarify the task.

    Should the event be run during the day (or at a specific time) on a specific day of the week?

    Does the event have to take place the next day if this programmed day (days) has passed but the PLC has been switched off?

    Should the event fire once if the PLC was turned off several times during the selected day?

    Perhaps a few more conditions need to be clarified.

     

    I think in the Visilogic Help example

    V350_Week_of_the_Year_Calculation.vlp

    it is a good idea to use the even and odd weeks of the year as a reason to change the bit you need at the beginning of the week.

    Although perhaps my assumption is wrong. There may be a problem with the New Year's transition.

     

  10. Hi.

    I was trying to simulate your problem on my PLC.

    Unfortunately, I could not find a way to identify the projects recorded in the log list of the PLC.

    Therefore, in my opinion, the best way to identify is the exact time of loading the project into the PLC.

    Each version of the project you have has a Signature log table in the Unilogic Tools menu.

    1887119301_Signaturelog.jpg.27c815be9b06c722d81d1369ce2dbabd.jpg

    Then in the Unistream you can find load time

    Uni_appl_log.thumb.jpg.88796a800e564c3f7c4275376bd6a7f7.jpg

  11. Hi.

    I've reviewed the documentation for your sensor and the Unistream I / O module you have.

    I must emphasize that the temperature inputs can be used only in the mV mode in the range of -70mV----+70mV (or use separate passive temperature sensor).

    Your sensor has 10mV per 1 degree so you can only see +7 degrees maximum at this input regardless of the settings.

    My recommendations - connect the output of the 0-1V temperature sensor to the second analog input in 0-10V mode. It has a 14-bit resolution and you can easily calculate the limits of temperature change with the help of a linearization FB.

     

  12. Hi,

    In Unilogic you can download an example from Unitronics and find the Communication folder. Please use the aperiodic Modbus master as an example.

    You can find a bit array in a tag, but you can also create a tag with the required array of voltage or current variables. As I saw from your photos, you read each variable at a separate address. Which at low transmission speeds significantly slows down the process.

    The Modbus communication standard provides the ability to read many variables whose addresses are sequentially starting from a specific specified starting address. Unfortunately, I do not have a device similar to your device to try to do. Maybe someone from the forum tried to do it in Unistream.

    I did things like that in Visilogic, but there was a slightly different approach to working with the Modbus network.

     

     

  13. Hi,

    as I thought - the addresses of the registers you need to read are nearby. I don't know if your meter supports sequential reading of a number of registers by one command. Therefore, I advise you to try to use an array of registers instead of one in the Unistream settings - for example 3 in the voltage read command.

    If you manage to perform such a trick, you will need significantly fewer consecutive commands from all devices to read your parameters.

    Probably faster to transfer a lot of apples in the basket than to send them one by one.

  14. To solve your problem, you need to determine if the polling speed of one meter is sufficient (that is, if you connect only one).

    If so, you can add three more RS485 modules to your PLC and communicate with all of them at the same time.

    This is how a slightly different problem was solved in this way. But this is probably the only way in your case.

     

     

×
×
  • Create New...