Jump to content

Dancho

Members
  • Content Count

    16
  • Joined

  • Last visited

Everything posted by Dancho

  1. Volume is simple to calculate. I will likely include the flow rate on the HMI some place for the operator, but until I have it worked out just right I don't want to bother. I made an attempt at calculating flow rate and had issues with sizes of tags (also used a different approach previously). The flow rates I'm calculating are between 0 and 4 GPM...Much easier to write some javascript to do some arithmetic in Node-red, then send the data off to a database...
  2. Good morning all! Happy Thursday! I've got a rung I'm modifying and wanted to pass this by as many eyes as will look. I think it will work, or is very close to working as intended, but I wanted to solicit as much feedback as I could about the approach, any stylistic feedback, etc. [I read a post this morning where Flex727 implored a forum member to put together programs with 1:1 networks to rungs. My program was not done this way, and I realized I may be learning bad habits, which are probably easiest to break at this point in the learning curve. Hence, this post.] H
  3. That is an option as well.....though I did try it. The arm is made of round stock, and the reflection from it was throwing an error in an extremely wide and random range. But always up...which is why I landed on taking the minimum element of an array. Now, if you wanted to share the averaging example I am ALLL eyes and ears.
  4. I haven't found anything about integrating an I2c sensor with Unistream. Is this a no-no? Or is the practical way to have an intermediary device communicating via serial or otherwise?
  5. Speaking of cycle times...I've wondered if there is a way to measure cycle time of a program? I can do it in Python...😝 Does it particularly matter, or should I assume that I will always get a reasonable cycle time unless I'm doing/something has gone terribly terribly wrong? I assume the watch dog timer on a PLC has to be extremely short as well?
  6. Fantastic. That is very helpful. I can appreciate 'almost never'. That being said, my program has evolved over time, 2 different system integrators, and now me. There are real numbers used in several places...generally related to drives and encoder outputs, speed, etc. Is this the 'right' time to use real numbers, or just another way to handle those things? I'm actually just converting from displacement/position to volume. Little bit easier, but I will keep this in the back of my mind.
  7. Good morning and happy Friday to all! I am still learning the ropes of PLCs ladder logic, etc and I am hoping to get some suggestions. I am from the world of traditional code-writing and microcontrollers, so the handling of arrays and datatypes within ladder logic has been a bit of a learning curve. Here's my situation: I am using a 4-20ma signal from a laser to measure the level of a material within a tank. The tank has a rotating arm which periodically passes through the laser beam. To filter this out, I am taking a measurement every .1 seconds and writing it to the 0th element
  8. I hate to revive this topic, however, I'm continuing to have issues related to serial TX from the USB host port. ....Frustrating. I took my working project, added two messages to be triggered once by the General.Initial Cycle bit aaaand....ALL the serial TX ceased to work, not just the boot up message. My MCU is set to flash the onboard LED when Serial.available() = true. I'm imagining it is detecting the voltage drop for the first bit. That happens and happened with the previous issues, however If my MCU sends any MQTT messages at all they are almost entirely 0x00 and few 0xff
  9. I am familiar with Moxa. I will take a look into that. The system integrator who built this system years ago put in an unmanaged, wired switch. We had SEW Movitracs which were Ethernet/IP (I believe), and the URB-TCP. His response to an email regarding connecting the PLC to our network was that it would require a managed switch. Maybe something with IP address assignment???
  10. The project I've been working with has an unmanaged switch, and thus has not been connected to our network. While searching for a solution to another issue involving the USB Host ports, I believe I read that a typical wifi adapter can be connected to the PLC. Is there specific hardware that is suggested? I'm looking to use it for MQTT pub and sub, mostly, possibly VNC.
  11. Solved. Even with an appropriate buffer size, the string length apparently affects the stability of the serial TX from the USB port. Below some threshold (haven't pinpointed the exact size), the serial comms are hit or miss. (String length is roughly related to number of tags within the strong, so that may also be the culprit) Previous buffer size was ~125ish bytes, and full string showed with a USB-RS232 and RS232-USB, but nothing on the Prolific device, etc. Now two strings ~75 bytes reliable communicate with a CP2012, PL2303TA (prolific) no problem. I'm a
  12. I got the EEWriter tool to invert signals if needed. It seems to have an authentic chip. VID and PID seem fine (devicehunt.com confirms). It says EEProm not written yet, though I'm not sure why that would make a difference... I also used the Prolific CheckChipVersion tool, and it doesn't appear to be counterfeit? Beyond that, my next guess is possibly STX and ETX on the string? Though I did not need them previously, as I mentioned, all serial comms were fine.
  13. I've tried a faster baud rate and a lower delay. I have not shortened the string length. Buffer size is adequate I believe. No change. I am very hesitant to point towards the PLC as the issue, but I am starting to lean that way. Especially since it worked flawlessly during the first boot up, then never again. Is there a way to rule out driver issues/ Prolific chip authenticity? What about flow control? Is there anything I could be missing? For reference: USB to TTL converter (https://www.amazon.com/gp/product/B07R8BQYW1/ref=ppx_yo_dt_b_asin_title_o00_s00?ie=U
  14. My TTL 3.3V converter arrived. All worked well for about four hours. During that time, I updated the program on the PLC and combined the output strings from 4 into 1. Since then, my serial broadcasting device can't make out a single character from the PLC USB port. The TTL converter has a PL2303TA, and I think I've ruled out that the signal 'became' inverted, or otherwise. Using a USB-RS232 and an RS233-USB I've confirmed the string is transmitting. My next steps: Change to a faster baud rate (19200 -> 115200) Lower delay time (50 -> 5 mS) .... Sh
  15. Prolific is what is supported, however I assume it is not unheard of for other hardware to work sporadically? This is what I'm waiting on (https://www.amazon.com/gp/product/B07R8BQYW1/ref=ppx_yo_dt_b_asin_title_o00_s00?ie=UTF8&psc=1). Do you think this is what I need? Here is my ladder for outputting the message(s) and the setting/resetting "send". I think I have an issue with my algorithm for cycling through messages. Shouldn't be a hard fix- it only sends the first message, never cycles through which messages. (I changed the original message to a few smaller messages in case th
  16. I really hate for my first forum post to be resurrecting a dead thread, however I'm doing this identical thing and having issues. Eturson, did you get this working? I am using a CP2102 converter chip on an ESP32 dev board (https://docs.zerynth.com/latest/official/board.zerynth.doit_esp32/docs/index.html). Amazon will be delivering a PL2303 USB to TTL adapter this afternoon. I'm hoping this fixes me. I initially had all working well directly from the USB host port to the micro-USB on my dev board. This worked until the next time the system was turned on (???).
×
×
  • Create New...