Jump to content

pascal

Members
  • Posts

    105
  • Joined

  • Last visited

  • Days Won

    14

pascal last won the day on May 9

pascal had the most liked content!

About pascal

  • Birthday 07/15/1969

Profile Information

  • Gender
    Male

Recent Profile Visitors

8,179 profile views

pascal's Achievements

UniGuru

UniGuru (4/4)

11

Reputation

  1. I'm just using an rest api to know the position of the sun at the actual moment of my actual place... i'm using ipgeolocation.io with a free license (only 1K requests/day ) that gives me always the correct position of the sun (or moon) Of course i'm using a unilogic plc....
  2. Tasanen, I've found something else what could be the problem.... you want to read MI320 of an V1210, you have to read from adres 320 (or 321...) and not 40321.... A V1210 is an enhanced vision PLC, so when you look into the help file, there you can find the correct adress ranges for communicating modbus
  3. maybe a little late, but just for knowing : you send byte 0+1 = identifier (can be anything) (0x0 0x1) byte 2+3 = always 0x0 0x0 byte 4+5 = length of the rest of the telegram (0x0 0x6, means still 6 bytes to send) byte 6 = slave adres (0x0 means adres 255) (I know....it's modbus) byte 7 : function code (0x3 -> read holding register) byte 8 + 9 : adress of start of holding register to read (0x9d80 = adres 40320.... -> maybe this is the mistake ?) byte 10 + 11 : number of registers to read (0x0 0x1 -> means 1 register or 2 bytes) in your python program, you ask 3 registers starting from 40321 (see figure below) but when I see what you are sending, it's not what you asked...
  4. The 1 digit difference.... nice said Ausman ! I don't think this is a Unitronics issue (Unilogic or Visilogic). This depends only on the manufacturer of the modbus device ! I've had devices I could use the mentioned adress of the manual and others, where I must substract 1 for correct reading of the data. Even whit the advanced modbus instructions, where you make your own modbustelegram's, it is trial and error.... I use powerhud modbus tester tool on my PC -> www.powerhud.com (also free and no timeout...) with more features (big or little endian,...)
  5. they just added this circular gauge of 360° in the new version !
  6. Like Joe already told us many many times..... it's better to split complex ladder into minor parts on different rungs..... sometimes you don't know how the compiler translate your thoughts
  7. Last week, I had a seriously problem.... I couldn't start the unilogic software (version 1.33.36) anymore. Every time, after showing the splash screen, I had an error and unilogic was shutting down. I made an urgent request to the support divison of Unitronic what could be the problem.... They took over my laptop to see what the problem could be (I don't see any other supplier of PLC's doing this) they found the problem -> in my regional settings, the list separator was a space -> just had to change this in comma and problem was fixed A great "THANK YOU" for the software department of Unitronics !!!!! of course, this is a bug and they are trying to solve this permanently (in a newer version or with a patch or workaround)
  8. 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....
  9. 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....
  10. unfortunately, you can't have a struct in a struct.... nor an array of structs 😒
  11. 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
  12. 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
  13. 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 ?
  14. 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 ?
×
×
  • Create New...

Important Information

This site uses cookies. By clicking I accept, you agree to their use.