LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Read parameters from equipment with other protocol

Solved!
Go to solution
Highlighted

What you posted should work, except you should just reed thirteen bytes?

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 11 of 19
(855 Views)
Highlighted

Hi Billko!

What do you mean when you say that? 

 

Thank you!

0 Kudos
Message 12 of 19
(820 Views)
Highlighted

Looks like you are reading 511 bytes.  Oh, and don't forget to close that TCP connection when you are done with it.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 13 of 19
(813 Views)
Highlighted

Hy!

 

I tried with 13 bytes and also with 511 because this equipment have 511 bytes with data! But i received error after the TCP read(with 13 bytes) "The network operation exceeded the user-specified or system time limit."

what do you think about this?

Thanks!

0 Kudos
Message 14 of 19
(798 Views)
Highlighted

@marius.lucian wrote:

Hy!

 

I tried with 13 bytes and also with 511 because this equipment have 511 bytes with data! But i received error after the TCP read(with 13 bytes) "The network operation exceeded the user-specified or system time limit."

what do you think about this?

Thanks!


I don't think it has 511 bytes, not according to the protocol.  According to the protocol, if bit 11 is 0, the expected length of the data is 4 bytes.  As per your example earlier, byte 11 in both send and receive are 0, so the send is expecting to send 13 bytes total, and you are exepcting 13 bytes total, which is exactly what your example on page 1 showed.

 

Your tasks, then, are:

 

  1. Read the first 7 bytes.
  2. From those 7 bytes, determine:
    1. Recipient address.
    2. Sender address.
    3. Parameter numbers.
      1. I would convert the bytes into an array of Boolean so you can address each bit directly.
  3. Read the amount of bytes determined by Parameter numbers bits 11 and 12.  (If bit 12 is 1, this was an error message and the following data will be 4 bytes in length.)
    1. Those bytes will be the Parameter value.
  4. Read the Checksum.
  5. Read the last byte.
  6. Calculate the actual checksum according to sections 2.1 or 2.2 as applicable.
  7. If the checksum values match, decode the values as per the manual.

 

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 15 of 19
(785 Views)
Highlighted

Hy Billko!

I tried to read 7 bytes, but the "TCP read " has an error; Can you help me?

0 Kudos
Message 16 of 19
(768 Views)
Highlighted
Solution
Accepted by topic author marius.lucian

Hello everyone!

I find the answer! Before reading the data, needed to give it a command, meaning to write. Now it works fine!

Thank you for all your time!

0 Kudos
Message 17 of 19
(755 Views)
Highlighted

@marius.lucian wrote:

Hello everyone!

I find the answer! Before reading the data, needed to give it a command, meaning to write. Now it works fine!

Thank you for all your time!


Yes, that is the way communications with an instrument usually works.  Sometimes data is streaming, but usually you have to ask for it.

 

Don't forget to mark your post as the solution so people can learn from it.  If you have more questions, please create a new topic so people can plainly see this is a new issue.

 

🙂

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 18 of 19
(753 Views)
Highlighted

Hy Billko!

 

Yes, i know this! But in the past i use the TCP protocol but I have not written a command to get an answer because i use some VI's (probably do this). TCP with ModBus Protocol. 

 

Thank you for all answers! 

0 Kudos
Message 19 of 19
(730 Views)