Jump to content

pascal

Members
  • Posts

    97
  • Joined

  • Last visited

  • Days Won

    12

Everything posted by pascal

  1. In my opinion, like the sequenc to "stop the motor and reverse the direction with another speed", you have to check this in accordance with the machine you want to control. first you have to stop the engine, then , when checked the motor is topped, sending the new speed and afterwards, setting the run command. If you want to take full control of the modbus communication, you have to create your own routines to make the modbus com. In fact, it's really simple..... modbus tcp/ip communication goes with a TCP connection and sending following data : transaction ID and protocol are 00 00 00 00 message : first byte is function code (like 03 for read holding register) second word (2 bytes) is startadres last word (2 bytes) number of words to read... check this manual : https://www.fernhillsoftware.com/help/drivers/modbus/modbus-protocol.html If you want to be sure, maybe packetsender(external free software found on the internet) can help you to send the commands to your machine and see how it reacts....
  2. I had a similar "problem" I made a calendar as a indexed table, with 366 days (so it's always a leap year) to know the index of the current day, I take the day of the month and add a fixed value corresponding the actual month..... so if we are may 2, then I add 91 minus 1 and my index in my data table is 92.... used a switch case....
  3. unfortunately, you can't have a struct in a struct.... nor an array of structs ๐Ÿ˜’
  4. have you tried to do it with aperiodic sending ? I don't know if the periodic sending is done on how you program your modbus thing. If you program a aperiodic, then you send your group in 1 command. but like ausman said -> maybe a good idea to send it with a pc software
  5. Gabriel, when you carefully read the alicat manual, you must send 2 modbus commands to set the setpoint... you must send the first 2 bytes to adress 1010 and the second 2 bytes to adress 1011... (i think) (taking care of big or little endian) so you can not send a real, but 2 int16 variables ! so you have to split your real into 2 int16 variables
  6. pascal

    Json struct in MQTT

    Hi Ivgeny, Thanks for your reply. Indeed, I think I have, like you said, to use the message composer for publishing nested structs in JSON and send them as raw data. I only have 1 question about the message composer -> you can scan a message, but what with receiving a variable as ascii, but the length of the ascii can be different... the ascii variable in JSON is always between "", but I don't see how to program this. I thought the ascii variable has a fixed length in message composer ?
  7. Hi, I want to communicate with a IoT trough MQTT. I managed to send simple JSON commands, but i'm looking how to configure more difficult JSON structs... I want to send this telegram to my IoT device, but I don't have any idea how to setup my json struct.... has to look like this..... { "FountainSchema": { "enable_pump_1": true, "startclock_pump_1": "08:30:00", "stopclock_pump_1": "14:00:00", "enable_remote_frequency": false, "remote_frequency": 32.8 } } I know I can make a struct like this : enable_pump_1 = BIT startclock_pump_1 = ascii[8] stopclock_pump_1 = ascii[8] enable_remote_frequency = BIT remรนote_frequency= BIT but how do I get the tag FountainSchema into my json struct ? like I want to receive some publications made from my IoT device : { "metrics" : [ { "name" : "response", "tags" : { "organization_id" : 1, "company_id" : 1, "tasktype_id" : 91, "service_id" : 77, "project_id" : 501, "task_id" : 1659, "property_id" : 111, "propertytype_id" : 999 }, "fields" : { "measurement" : "switch_pump_1", "value" : 5, "type" : "switch" }, "timestamp" : "2024-02-14T14:45:16.000Z" } ] } how and where do I program my JSON struct I want to publish or to subscribe ?
  8. Marko, you can't reset an input.... an input is not like a self made bit. Like you said, you have to copy the state of your inputs into another tag(struct) and reset your tag....
  9. Saragani, I send the project already to support -> ticket UNI-88397 to Hananel Vanunu In this project I have also problems with modbus TCP/IP communication (also a post on the forum : MODBUS master problem connecting remote slave(s)) this error (for each loop) can be found in project is to big to upload here...
  10. I've made a routine - a for each loop - with a list of tags including buffer tags and real tags. I want to copy one tag (real) into a data table with the instruction Set DTI column value B = real value C= real value of the structure current item after compiling I get a lot of errors.... as you can see, 118 error's........ But I found a solution -> store the real tag of my structure into a local real tag and then put this tag as value to store (C), then I have no error's..... Good to know, so I wanted to share this with thee community (or maybe this is a bug?)
  11. Hi, I have a table with all my IP adress of all my connected things. I made a webpage, showing my table with all the IP adresses when clicking on a field in the table, I put the IPadress (ASCII) into a tag -> IP adres (reading the selected row of the datatable) on the webpage a put a hyperlink "GO TO" with the adress of this hyperlink the value of tag IP adress but when clicking on the hyperlink, he's calling another IP adress..... I did an inspect of the webpage (clicking right mouse button ๐Ÿ˜) and found something strange.... BUT I FOUND a solution ? -> the problem is the leading zero's of the IP adres in my tag.... when I remove the leading zero's, then I have a correct hyperlink (only tried one (172.20.25.40) something to keep in mind...
  12. Tim, what do you mean with set an instance ? you can read a row of the table, change the value of column 3 and save again the row....
  13. Elad, with UaExpert, when disconnecting the server, my counters goes from 2 to 1 (because kepware is also connected)... But .... today I was trying some more things on my kepware and everything is working fine now. The thing is, I didn't changed anything. Not on my PLC and not on my Kepware... (altough I deleted on PLC side some not used communication protocols ( on CPU, deleted 1 UDP port I didn't used anymore and 1 TCP server with 16 number of connections, also didn't used)) Last friday this hadn't brought me a solution. When I started checking on monday again, suddenly it worked ??????? strange..... I still have to check some things with our IT department to know why it works (now)..... I'm not accusing somebody, but most of my communication problems are IT related ๐Ÿ˜๐Ÿ˜๐Ÿ˜(and they never never did something) PS : When I had al the trouble (last week) and I disconnected Kepware and my UaExpert, the number of connected clients went from 2 to 1(unclean exit Kepware and clean exit of UAexpert), but after the not clean disconnection of Kepware I couldn't even connect again with UaExpert.... I'll keep you all informed of my situation..... TO BE CONTINUED....
  14. i'm using OPC-UA, but I don't see any certificates.... altough my system is reading the OPC-UA variables without problem.... (unless I disconnect my OPC-UA client -> see my post on Unilogic software) i'm trying to copy my opc ua clients certificate to the PLC, but I don't know in wich directory I should place the certificate on my usb...
  15. Hi, my system : USP-104-X10 with B10 I have 3 PLC's (all same model and firmware (1.33.161)) communicating via OPC UA server with Kepware Everything is working perfectly.....until I stop my Kepware (to do some upgrading or other stuff) When I shutdown my Kepware I see following OPC-AU diagnostics differences : PLC A : PLC B: You see the difference in the current session of current subscription count -> PLC A is 0 and on PLC B it stays on 1.... When I restart my Kepware, I'm able to reconnect on PLC A, but not on B ! My Kepware gives me following error : (PLC B is GBS UNI BD1) The PLC B is actually refusing the communication The only thing is to give a cold boot on the PLC B to restart my communication... I checked (several times already ๐Ÿ˜’๐Ÿ˜’๐Ÿ˜’) all parameters (on PLC side and on KEPWARE) but all are the same... any suggestions ?
  16. things to check -> wiring -> already changed the D+ and D- ??? in modbus general -> active period is Timer 1.out -> try general.on, then you are sure it's always working....
  17. about the type of operation -> just read holding register (type 3 of modbus) I read my weather station every 10 seconds my float type is here NONE, but this is made with a previous version of unilogic, where I had to make my own swap "thing" So no program is needed, only configuration... that's all you need to do.... If you have a incorrect status of your modbus slave, try to change the address you want to read.... sometimes the manual say's it starts at adres 1, but in modbus language it could be address 0 (or 2 ?)
  18. ROG, very simple : make a variable, type buffer, length 4 address -> depending on the data sheet of your PH meter depending on the modbus type, you need to change float type -> if the ph meter sends first the MSB or the LSB ??? a float is made of 4 bytes -> how it is build check this url : https://www.h-schmidt.net/FloatConverter/IEEE754.html after knowing how your meter is transmitting the bytes, then you can chose the correct type of float type and in your ladder -> just copy buffer to tag..... that's it....
  19. Ballza, URA-0400T -> 4 inputs 0..20mA or 4..20mA You use a linearize function with a = reading input URA 0400T, b= value 0 (if it's 0mA) c= depends of your analog device when it's 0mA D=65535 (16 bits = 20mA) and E the value of your analog device when he outputs 20mA if your device is 20mA = 100ยฐC of 100 bar -> then you say value E=100x10 = 1000 When showing the value on screen or webserver -> you choose decimal point location= 1 it's that simple....
  20. hare1978, the modbus communication gives -> error 3 = illegal data value..... I see you want data of adress 1.... Sometimes the adresses of the modbus registers starts at 0, instead of 1... This is depending of the manufacturer of your modbus device..... I should try using adress 0 and see what happens.... Maybe the length of the received bytes isn't what you expect ?
  21. Hi GermanM, You HAVE to use struct's ! When calling a function, you don't use every variable of that struct as seperate Function_in, but only the struct itself... when you change something of the data of your "input" struct variable (like in my case here "hgrp 2 PR spots") after quitting the function, the values are changed also my struct has several ints, bits, reals, text..... I call the function call scene check with the variable struct hgrp 2... , do something in that function, like setting a bit, changing text or whatever after calling the function, the bit's are set, text has changed.... advantage of using structs -> you can use them in data tables.... easy for debugging, just make a screen of that table and you see all variables of your structs (same structs of course)
  22. I prefer the TCP/URB IO modules instead of the "local" IO modules of unistream PLC's -> the analog output modules (like ARU-0004X) are galvanic isolated , the UIA-0006 are not (already blown a few up๐Ÿ˜’๐Ÿ˜’) Remember that you can only use max. 8 URB/TCP modules connected to one PLC.... another advantage -> when you loose connection with a URB adapter, the rest is still available....
  23. Dave, https://onlinepngtools.com/create-transparent-png I often use this for modification of self designed png files
  24. yes I have (altough every PID uses the same pid auto_parameters) for each PID i have to connect the proces value, set point,.... and run the PID and this 40 times..... I tried to make a subroutine with al these parameters as input variables and in the subroutine call PID -> not working
  25. Meldaw, I had the same "issue" I control 40 heaters with a pid, so I made 1 subroutine that i called 40 times with different parameters..... DIDN'T work !!!!! For each process, you have to use a different PID ! PID is running in background of PLC -> so you can't use 1 PID with different IO's....
ร—
ร—
  • Create New...