Jump to content

Fernando Castro

Members
  • Posts

    264
  • Joined

  • Last visited

  • Days Won

    24

Posts posted by Fernando Castro

  1. 1 hour ago, vpotanka said:

    Hi,

    I have an issue with Unilogics Set Coil. It won't stay high even when I have no other instances of the tag in the program. I thought it was just the display being glitchy so I added a counter to verify. It deenergizes then reenergizes with every cycle. I've attached a very simple program for you to see the issue.

    This is pretty serious. How am I supposed to write a basic program?

    Thanks.

    UnitlogicsSetCoilBug.jpg

    just to clarify, on this screenshot rung 2 its continuously counting...

    I believe that you intended to count only if FirstScanBit changes from false to true. In that case the correct logic is to use a positive transition contact:

     

    ------|p|--------[Add]-----

    • Upvote 1
  2. Let me know if it works, I have asked chat GPT for some stuff, but I don't really trust its results. at least as something that I could copy/paste and it work at the first try but if you know what you are doing then yes, with some tweaks you could make it work.

     

    btw Ising Node-Red it should look like something like this:

    the buffer-parser node just in case that you need to swap bytes or something like that.

     image.png.bff0eef2214eef8a886cbafc455b16ea.png

     

    The beauty of Node-Red is that runs in the background, and you access thru a web interface. 
     

     

  3. 6 hours ago, Hoops123 said:

    Hi,

    Has anyone attempted to convert modbus RTU to TCP using C# or any other PC based method?

    We are about to purchase 40 energy meters that use modbus RTU for each of the machines on the shop floor, we are told by the saleman that we have to purchase modbus RTU to TCP converters to get the data on the network. At $200 each multiplied by 40, i wondering if I can get around having to buy them. Each machine has a normal PC connected to it, so I'm thinking I can send the RTU to the PC via a serial port then covert to TCP to get the data on the network.

    I am pretty sure that there are already solutions for this, but the short answer is YES, there are Modbus libraries for pretty much anything.

    also, which will be the end destination of the data? if it is only for data collection purposes, dumping everything into a database could be a good approach I suggest using Influx DB/Telegraf (Its free and open source self-hosted, or you could pay and use the cloud):

    Modbus Master Monitoring | Influx Data

    you could install a Telegraf client on each machine and configure the output plugin to dump the data into a single database.

    other solution, could be use Node-red + the Modbus nodes, you could create a virtual Master to read from the physical slaves, then send the data over Modbus TCP to the real Master:

    Node-RED (nodered.org).

    Also, open source and easier since is No code" interface".

    The only caveat using either of those suggestions is that you need to have the software running as services on starting in each computer.

     

     

     

     

  4. Honestly it best resource is the documentation of each brand, the functions and its implementation in each PLC are different between brands.

    the most "universal" is any book related to digital logic / signals (bit, bytes, logic gates etc..). followed by pure electric circuitry (open/close contacts coils).


     at the end ladder logic is just mimicking an electric circuit, and most functions are pure digital logic.

    that is the only common thing between brands.

     

    Having said that, any programming language will be vastly different from ladder logic (which is the most "universal thing on PLC languages), so the thinking approach cannot be the same.

    Best advice I can give is: Assume everything happens in parallel at the same time (even that there is a time between scans) any "async logic" that you need must be designed by you. the main difference between PLCs and micro controllers is that on a machine a sensor could be triggered at any time, there could be loose connections, dirty sensors and other stuff that could trigger bits ON/OFF in an unexpected way.

     

     

     

     

    • Like 1
  5. 12 hours ago, Joe Tauser said:

    I dug into the floating point over Modbus topic a few years ago when someone was having trouble reading floats from an energy meter.  Turns out not everyone agrees on the word order of floating point data when it comes to various manufacturers.  The word order of a floating point data type is not in the Modbus specification.

    This post was regarding a UniStream, but the concept remains the same.  If you're communicating between two Unitronics devices, you're OK.  If you're getting data from something else via Modbus, you have a 50% chance of getting the data in the wrong order.

     

    If you read the floats from your device into an MF register and the value looks OK then you're done.  

    As Fernando points out above, the way to tell is to run the floating point value you expect to receive through an online converter that will give you the value of the float in hex.   You can use a STRUCT (collect) block as Fernando does to do a raw bit conversion of an MF to two MIs , which will allow you to examine the MF's value as hex codes.  If the order doesn't match what the online converter gives you, then use STORE blocks to swap their order into a new buffer set of MIs.  Then use a STRUCT (extract) to convert these raw bits into an MF register.

    Yes, it's a bit complicated.  Visions don't handle floats well.  If you want to go down that road then you have to get creative.

    Joe T.

    just to add to Joe's response, there is a SWAP BYTES function on visilogic that also help on rearranging bytes.

    the best way to work with this, is using known values so you can see what hexadecimal numbers are and since you know what to expect, you can easily spot the correct order.

  6. On 3/21/2023 at 11:49 AM, Fernando Castro said:

    I think floats on visilogic already are expressed using IEE-754 standard couldn't find anything in the documentation.

    However, I need to communicate with a slave device precisely sending IEEE-754 floats over Modbus-TCP IP.

    I should be testing that in the following weeks (Need to finish some other stuff first). 

    Seems that my assumption was correct. I just tested using struct function to copy the value stored on a MF to 2 MIs and I got the expected hex values.... you can do it in reverse to build the float number.

    image.png.2f61171c6cc4dfe69b84a75c181a1c52.png

    image.png.0548074f12913ecadcacc10659a5d596.png

     

    image.thumb.png.658faddcaea6be12b207b40988a9a0b4.png

    • Upvote 1
  7. 1 hour ago, LeonMötter said:

    So i have a weird problem where i have a source writing to the same MI (MI661 in a V560) that i am using to store the value of a temperature sensor.  The problem is that i don't know where it is coming from and the more i started looking the stranger it seems to get. I found the problem when i was looking at data from the temperature sensor a noticed that where a lot of points where the value fell below expected values. (normal is between 3400 and 350 and sometimes is noticed a value somewhere between 248 and 272). 

    To find out in which part of my program i screwed up i disabled the sensor and i used the debugger to stop the PLC program. And then i noticed the first weird thing. Normally when the PLC is in stop mode you can write a Mi to zero and it should stay that way until the program is started again. In this case that doesn't happen. when i write a 0 to the MI it will immediately change back to the strange value it was on before, regardless of the state of the PLC.

    Because of this, i thought maybe the source is not in the PLC itself but in one of the connected network devices. This PLC is a Modbus slave to 2 masters. The first is another Unitronics PLC (SM35). The second is a SCADA package (ignition). I disconnect them both and still something is writing to this MI.

    So to summarize i have something writing to a MI even when the PLC is in stop mode and there is no network connection or anything else. 

    Anybody any idea what could be going on here? do i have a ghost in my machine? :wacko:

    I have found issues like this. have you in a previous program used an alarm and then deleted it?.

    I found that if you delete the alarm group without reassigning the MIs/MBs first those registers get stuck with the previous assigned values, even using the search function won't find that operand being used somewhere else.

     

     

  8. 18 hours ago, William Rodrigues said:
    Hello
    
    I need help to convert a decimal and hexacimal value in visiologic software.
    
    This conversion needs to be in IEEE-754 hex format.
    
    Thank you all!

    I think floats on visilogic already are expressed using IEE-754 standard couldn't find anything in the documentation.

    However, I need to communicate with a slave device precisely sending IEEE-754 floats over Modbus-TCP IP.

    I should be testing that in the following weeks (Need to finish some other stuff first). 

  9. According to IAI 

    EtherNet/IP PCON ACON Controllers - IAI America (intelligentactuator.com)

    that is specifically designed to use ETHERNET- IP which is proprietary AB protocol.

    having said that you could:

    a) replace the controller.

    b) get another PLC with Ethernet-IP protocol.

    c) get an Ethernet-IP to Modbus TCP converter.

    all of those 3 options will probably cost about the same.

  10. 5 hours ago, Alison said:

    Okay, bear with me here.

     

    I have a Vision 350 J T38. This has a USB micro port for programming (great, that works, yay, and I am happily plugging away through the basics of ladder logic, thank you for that!)

    It also has an RJ11 port, and RJ45 which is labelled EXP PORT.

    The VFD I want to talk to has a USB port(s).

    I have also got a USB/RS485 adaptor cable, which has 6 wires on - red, green, brown and black, plus orange and yellow.

    How do I get from the USB port on the VFD, to the RJ11 port on the PLC? I have some RJ11 phone cable but that only has four wires in.  I am assuming the RJ45 port on the PLC is for extra I/O units only, or am I making an error here?

     

    Do you have the VFD model? its odd to me that it has an USB port, I haven't seen any RS4-85 port using USB (I may be wrong), but I have seen RS485-To USB converters embedded (Like Unitronics do with the serial port and mini USB, which is the same com port).

    If its RS485 you just need 2 wires (and  Ground).  check that the hardware configuration on the PLC is set to RS-485.

  11. I tested OPC Expert with Unitronics and it worked (the evaluation license at least) OPC Expert also allows you to "bridge" Unitronics OPC Server to other protocols like OPC UA. Wich could be what you need if you already have any other OPC client of your preference running.

     

    I tested that like 2 years ago. but at the end I ended using Modbus TCP/IP and to directly communicate to the PLCs, so no OPC server needed with this architecture.

  12. I have NO experience on elevators.

    having said that I don't think it is challenging application by the technical aspects of it.

    Maybe I am wrong, I assume that it requires specific safety components and of course there should be some specific compliance related to that, and that is why usually the price is high.

    Usually, safetey related components needs to meet some test criteria and, sure you can do safety circuits without safety components, but you need to design redundancies and know all the MTTF values... 

    I think this is the kind of projects that any experienced controls engineer will not take if it is not under his area of expertise also for the liability...

    once a more experienced collage told me. "The company the quotes the higher, with the longest delivery time, and that seems that they don't even want to take the project is the one that actually knows how to do the job".

    Not always the case, but I bet you this time it is.

     

    • Upvote 1
  13. I have a similar application (up to 8 analog signals, and recipe-based control with ramping functions) the recipe side will require some clever codding depending on the length of it because you will be limited by the number of objects that you can fit in one single screen. I developed the same software for 2 vision series PLC: v700 & v570 at the beginning I thought v700 was more modern but now I prefer v570.

    3 hours ago, Flex727 said:

    Based on this, my first recommendation would be the V700. It has a 7" color touchscreen with a widescreen format. If you should decide you need a larger screen, then the V1040 (10" screen) or V1210 (12" screen) are available. With all the Vision PLCs you can access the PLC through Ethernet  from a PC or your phone. The V700 can be in constant communication with 8 other devices simultaneously over Ethernet and also has serial comms, if needed.

    I have no idea on prices because the hardware already existed whenever I took the role but, in my opinion, v570 is way better than v700 given the following scenario:

    v700 is bigger yes, but the keyboard is actually smaller than the v570. 

    If you are going to use SD cards to store logs, trends and recipes. the SD card screen function is not properly implemented on the v700 it looks very tiny.

    The only reason I recommend the v700 is if you are going to use more than 4 ethernet connections at the same time.

    I will say that 1 socket for file transfer (SD card explorer), 1 for remote operator, 1 to send all process variables to a centralized location and an extra one for any other feature is more than enough for most scenarios.

     

    Also, I think that on v570 the ethernet card is an add on that needs to be purchased apart.

     

     

  14. 52 minutes ago, RickL said:

    ........ I would close the window just to look see at a full screen view of my HMI is all   :  )

    wont be doing that anymore!   :  )

    NOTE: You can close the bottom "output" window with no problems! Just never close the "explorer window!

     

    NOTE: You would think they may want to get rid of that "X" icon on the explorer window if you shouldn't be able to close it!

    Probably that only happens on your installation. that doesn't happen on mine for sure... but if it makes you feel better there are some other errors on my computer 😂, particularly debugging one specific routine in one specific program on which I cannot be more than 10 minutes on online mode before it crashes, I always assumed is related to some variable being overflown (the sub in question handles the communication to other devices and there are some DWs in there that eventually reach their limit).

     

    image.png.ddebee8e62fc98b1ff3c7ac6136e420f.png

  15. 2 hours ago, Alison said:

    Both units use Modbus RTU over serial which is a relief, I don't want to have to learn networking too!!

    the protocol works pretty much the same over TCP/IP or serial

    the main point to understand in the protocol is that Modbus works with memory registers and that there is a table and "register codes" depending on the type of each variable.

    also, some devices start counting from 0 others from 1 so it depends really on the implementation of the protocol on each device, for example in the Unitronics documentation there is a "formula" on how to calculate the Modbus addressess based on the type of operand. Wich, I think is different based if its "Enhanced" version or "standard" version.  having said that, that doesn't mean anything without understanding how the Modbus addresses works.

  16. 4 hours ago, LeonMötter said:

    oh i am well aware that PLC's in general are not meant to be used in this way. In an earlier discussion in the company we discussed sending the data to a server/computer to do the calculations. That would have made the calculation part a lot simpler. Downside is that the machine is going to be depended of that server and the connection to it. A long time ago we have made the decision to not make any of our production machines depended of external computing. so we opted for the hard path.

    That being said we already made great progress in programming and can actually achieve a pretty accurate model in a decent amount of time (the latest test we did a few 100 calculations in 20 seconds). The problem is that we don't really understand where the precision is lost. if we know that we can compensate for that. 

     

    The precision is lost because its a 32-bit floating number... there is a formula on how the numbers are "encoded" you technically could use 2 32-bit operands to work with 64-bit floats but that will require to do all the math to "encode" and decode the numbers.

    this site has some useful information about that: IEEE-754 Reference Material (cuny.edu) but you can google the formulas on how to operate on float 32 or float 64.

    I don't really know your process but sure it should be a workaround instead of doing all with floating numbers.

    I have seen some other approaches like storing all as integers and using a decimal position on a different operand or having an operand per "decimal place". In any case I agree with the collages that maybe the PLC or at least this PLC is not the best tool for the job. I am sure that there are 64bit ones.

  17. 3 hours ago, Edgar m said:

    Hola buen dia a todos, tengo una duda con la comunicacion entre el PLC y la PC, solo cuanto con un cable rj45 y adaptador a de ese able (Ethenet) a usb, con ese puedo programar o es necesario el RS232-CB1 ?  

    Depende, yo solo e usado V700 y V570 y en ambos puedes usar ethernet para programar... pero si y solo si el socket ha sido iniciado y configurado para comunicarse previamente.

    poer lo que si es un PLC en blanco, primero tienes que crear un proyecto habilitar la comunicación por ethernet descargarlo por el puerto serial, y ya una vez inicializado vas a poder programarlo por ethernet siempre y cuanto tengas el mismo nombre  dirección IP del PLC

  18. On 3/3/2023 at 6:53 AM, Alison said:

    Hi all. I am brand new to all this, so please don't savage me too badly.

    I have a Vision 350 here, and I want to get it talking to two different Modbus machines - a heat pump and a variable speed motor drive. Initially I just want to poll the units from my Vision to find out stuff like speed of drive, or heat pump temp. I have modbus "maps" for both units so that helps! Eventually I'd like to use the Vision to control our entire pool set-up - I work for a swimming pool equipment wholesaler. This is really just me trying to teach myself something new, but getting more control over the VSD would be great (eventually).

    I've started off following the videos on Modbus and on PLC basics but I'm struggling with some things, just because I'm no programmer and this is all new to me.  Could anyone please suggest some good starting points - tutorials, videos, further reading - that might help? For example I don't know why, as the first step in the Modbus vids, a system bit is used in the first net. I must have missed what this is/does somewhere - I feel like I have missed a set of videos inbetween the "What is a PLC/HMI" and "How to work Modbus" ones!!

    Thus far my understanding is that you make a pretty interface screen, tie the things you're doing on that screen to "nets" (which are basically steps in a program) and the Vision will follow the structure of the ladder from top to bottom.  I *think* that the Vision (as Master) polls the Slave units, gets data from them from whichever modbus address I point it at, loads that data into its own memory and uses the data as variables that I've defined, then keeps on repeating that process. Am I anywhere near right, here?

    Thanks

     

    Alison

    it uses SB because yo just need to run it once at the beginning, there are some notes about that on the documentation..

     

    image.thumb.png.9430fba1ca614adca26db980538c64b7.png

     

    I would start reading, reading the documentation regarding the Modbus protocol in general.

     

  19. On 3/2/2023 at 3:38 PM, mr ford said:

    I couldn't activate under version 9.8.91. The off-line register gave me a key to send to register for the activation code, which I received, but then had no means to input that code, as the 'activate visilogic' option under 'Register' gave me only the on-line form which couldn't connect as per the proxy settings issues etc. mentioned by others above. There was then no option to proceed to the next stage to input the code I'd received.

    The solution was to download the latest version (9.8.96), which had no problems with the registration connecting, code issuance and completion.

    I think that once you have the code the activation park is done in visilogic on the part that says activate software license or something like that... I don't remember and since I already was able to activate it, I can no longer see that menu option.

  20. On 2/26/2023 at 5:30 AM, RickL said:

    I have several MB types that I need to convert to MI types before I can use them in a logic "OR" function.

    An example of one:

    I need to convert my MB111 (set =1 / reset =0 type)   this is my MB  " A" input into the "AND" function block

    Looks like the converted MB111 will  reside at my newly  assigned, lets say MI222 location  - "B" input of the "AND" function block

    I dont understand the "C" input assignment and how to set it.    My span of numbers are 0 to 1 only.

     

    BIT->NUM: B (Destination)         <  what should this look like?  do I erase  (Destination) ?

    BIT->NUM: C (Length)                    <  what should this look like?  do I erase  (Length) ?

    Thanks!

    You don't need to do conversions; logic functions are not intended to be used on BOOLEAN values those functions are for INTEGER values.

     

    in the ladder logic you already are working with logic functions already.

    AND:

     -----| |---| | ------(   )

    OR:

    ---| |----.----------(   )

    ---| |----'

     

  21. 4 hours ago, Tara said:

    Hi Fernando, this file is named Offline Activator.exe.config for me and can't be opened. And the other file named Offline Activator open a registration box who asks to complete informations.

    But i don't have a file that prompt a code when clicking on it.

    Do you have any idea of what is the problem ?

    is the. exe and it's that form, you complete the information, and it is going to throw a short code XXXXX-XXXXX  (10 digits) which is the one that you need to send to Unitronics support so they can give you the activation code.

  22. 22 hours ago, Flex727 said:

    This is always wise, but FYI for OP - standard download should not disturb operand values.

    Trust me on this one .... you never know, better to be safe than sorry.

    seriously there is a non-zero chance that something will be messed up on a new download.

    • Like 1
  23. 17 hours ago, Jhav said:

    I am trying to show gallons per minute using the linearization function. the flow meter i am using has a measuring range of 0.26-16 GPM, is there a way to enter 0.26 of a gallon in the Y1 portion of the linearization function block?  

     

    PLC basics... PLCS don't like decimals (floating numbers) well it's more like floating numbers require more memory to handle and even that there are functions to properly work with them, most of the time it's just way mor easier to shift some zeroes and work with 26 to 1600  instead of 0.26 to 16.00 and just place the decimal point in the hundreds place on the HMI where a human will be reading the number. 

    • Upvote 1
×
×
  • Create New...