Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation since 09/08/2019 in all areas

  1. 1 point
    Hi, What is the best solution for converting two 16 bits registers from modbus device to floating point in UniStream? 2x16 bit registers = 32 int to float. (IEEE754 single pr). Is there any FB for this kind of conversion? The device information: I don´t believe I have to do this manually with calculation according to standard IEEE 754. If anybody know any method, it will be appreciated.
  2. 1 point
    I thank the Unitronics team for making me the part of the beta project.
  3. 1 point
    As a final comment, what I put out is just that - math. Your final results may vary. Don't order 100 pieces - start with something like 5. <rant> Define "quite expensive". Is this data kind of important or very important? I think management is freaking out over the overall cost of the project and struggling to get the cost down and pointing to a large dollar line item without quite understanding what's involved to roll your own sensor. When I was a young man I tried rolling my own 4-wire ohmmeter that was an integral part of a wire plating process. The short version is we tried to make my circuit work for a month in production only to determine that what I had come up with was not accurate enough nor could overcome the inherent noise in the process. We had to buy a $5K meter that worked in the process right out of the box. So often I see a company hire a young engineer and put him in charge of something that is really out of his league. "Oh, he's and engineer! He can figure it out!" But what's missing is the crusty old engineer to give him guidance. So he comes up with a process controller / monitor that is based on an Arduino or a Raspberry Pi. And he thinks he's a genius, just ask him. And then he goes and gets another job and nobody has a clue how it works. Consider the value of your time and how much damage you will cause if this doesn't work or is flakey. Also consider who gets to maintain this thing. If you built it, you are married to it. If you do go forward with this be sure to document the shit out of it, including ordering spare parts and writing a calibration procedure. That's what professionals do. </rant> Joe T.
  4. 1 point
    BTW, I would like to say that I'm new to the Unitronics Platform (Mostly done Siemens/AB last 15 years) and these last 3 months I have used these forums for a lot of self teach. With that being said, you stand out in these forums as a guy that is extremely knowledgeable and very patient/helpful with everyone. Just want to say thanks a million from the green guys like me! Chris
  5. 1 point
    Those would be the Visilogic function blocks. As you've already done, read the data from the device into a UINT32 tag. For testing I made one called "Read Data" that I could simulate, and a tag called "Conv Value" to hold the swapped bytes. The data will land in a REAL called "Converted". In UniStreamSpeak- 1. Copy the data you read from the device to the working tag and Swap the bytes using "Logic->Swap Single Tag Bytes" with Swap Type.ABCD_CDAB. 2. Copy the swapped data to a 4 byte BUFFER array type so you can manipulate the memory directly. Mine is "Conv Buffer[4]". 3. Use "Buffer Tools->Copy Tag to Buffer" to get the "Conv Value" data into the buffer tag and "Copy Buffer to Tag" to get it from the buffer to the REAL "Converted". There you go. Sorry it doesn't have all the digits you're looking for. If you need to convert several values write a UDFB to move the data into this logic with a pointer. Joe T.
  6. 1 point
    Hi Nahum, Thanks for the advice. I also did some testing using a PC based Modbus master simulator (ModScan) and confirmed the situation as well. I also found that there was an offset of 1 between the internal UniLogic address value (in the Modbus Slave configuration) and the external Modbus address. For example coil register 9472 appears as 09473 (Read Coils (1)) or 19473 (Read Discrete Inputs (2)) I think it would be a valuable addition to have an explanation of this in the UniLogic help file under Modbus Slave. For example: Coil values can be read using either Read Coils (1) or Read Discrete Inputs (2). For example coil address 4444 can be accessed as either 04445 (Read Coils (1)) or 14445 (Read Discrete Inputs (2)) Register values can be read using either Read Holding Registers (3) or Read Inputs Registers (4). For example Register address 1111 can be read as either 41112 (Read Holding Registers (3)) or 31112 (Read Inputs Registers (4)) Maybe add a configurable offset value to UniLogic, so this offset can be corrected in future applications, without destroying backward compatibility?? It has always been a common "gotcha" with Modbus, to discover who counts from "0" and who counts from "1". Thanks, Simon
  7. 1 point
    Is this another solution? Just learned to use the copy byte function in the logic menu.
×
×
  • Create New...