-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support of string datatype #17
Comments
duplicate of #15 ? |
Since I saw no response i created this new topic to verify if others might have found a solution. |
I made a way to read strings in order to get data from a plc to a .csv but it's time consuming. I have a flow that i could post but due to the number of SINT types needed to make a full string it's a rather large bit of text. (let me know if that isn't an issue and i'll post it here) Basically, i followed these steps ~"all tag" E/ip node that that's scanning every SINT in the desired STRING tag (string.DATA[#]) PLC side |
I'm just going to post this, if it's too much just let me know and i'll remove. This is a test sample of how i was able to get STRING and DINT data into a csv file
|
That sounds like a reasonable solution. Thanks for sharing! I tried it with ethernet/ip messages, I ended up doing a simular thing. |
@Archymedys do you know if it is possible to have a variable tagname as ethernet/ip output? I also want to send a string to the PLC but instead of selecting all tags manualy I could run a loop of an array to place the data. But so far i did not succeed. |
I don't yet have the answer to that one. It would be simpler if the nodes could handle tag arrays though. |
I suppose, one could setup an indirect addressing "handshake loop" with the PLC, basically populating a STRING one SINT at a time. |
The library this node is built upon (node-ethernet-ip) has had very few updates lately but one of the forks for it has integrated LINT and STRING types. The link is https://github.com/SerafinTech/node-ethernet-ip but use it as your own risk as the author has stated they have not completed all the necessary testing. If possible, someone might be able to use this fork to read string types. |
Somebody has published this node-red pallete supporting String https://www.npmjs.com/package/node-red-contrib-cip-ethernet-ip-strings-mfgx |
I have made my own work-around for dealing with strings, since I only need to read about a half dozen. I have the eth-ip node read every value of the .Data array, as well as the .LEN value. Then I use the built-in javascript "String.fromCharCode()" function to do the ASCII conversion for me, and just concatenate the string together. I'm sure it's not super efficient, but it does work. And if the strings are shorter, the .LEN helps make it a litter better instead of running a bunch of code on empty values. If someone was struggling to deal with just a few strings, so they can move on with the rest of their project, here is what I did, just using some globals to store the string values for me so I can do what I wish to with them later in the flow. `var oldRecipe = global.get('Recipe'); var recipe = ""; for (var i = 0; i < length; i++) { msg.payload = {}; if (oldRecipe !== recipe) { |
Hi @msienkow could you paste a flow for your solution? |
Here is an example flow. I have moved on from using this. I kept getting unhandled promises and timeouts after running for a couple of days. I needed my application to run non-stop, regardless if it can communicate with the PLC or not. I ended up move on to pycomm3 and python and have had much better luck. However here is a working example of what I was doing.
|
Thank you for replying and providing the samples I really appreciate that. |
+1 this should be supported |
Is there any news on when the string data type will be supported?
Any others who have found different ways to send and receive strings?
The text was updated successfully, but these errors were encountered: