Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

fpga serial master query

I am using the MB FPGA Serial Master Query.vi.  When I specify the 'Quantity' value in the 'Modbus Command' to any value I always get an output 'Register' array size of 1.  I should get an array size specified by 'Quantity' value.  Can anyone explain this behavior?  I am using LabVIEW 2011 RT with FPGA for cRIO.  I am using NI's Modbus library.

0 Kudos
Message 1 of 5
(5,836 Views)

Hello faustina,

 

Can you please provide more information regarding you application and what you are trying to do. Looking at the help documentation for the MB Serial Master Query.vi you can see the Quantity input parameter represents how many holding registers to read from the slave. The VI returns the holding register at Starting Address and each following holding register up to Quantity. For example, if Starting Address is 0 and Quantity is 4, the VI reads holding registers from the slave at address 0, 1, 2, and 3.

 

modbus lib vi.PNG 

The Holding Registers output represents the data read from the slave (array of U16). What values are you setting for the Starting Address and the Quantity?

 

Paul-B

Applications Engineer
National Instruments
0 Kudos
Message 2 of 5
(5,778 Views)

Apparently the problem was in the FPGA code.  When I set the "Transceiver Mode" using MB FPGA Serial Init.vi, I did not also set this parameter for all the ports of my Serial connection.  Once I fixed that I received the proper number of elements in the array.

0 Kudos
Message 3 of 5
(5,763 Views)

Can someone explain why i am getting this error. Picture is attached and the error window is included. I am using same vi and getting this error.

0 Kudos
Message 4 of 5
(5,581 Views)

Omishra,

This error is commonly caused by a hardware fault.  Make sure that your serial port (or whatever bus your using), is working by using one of the VISA examples found in the NI Example Finder (Help » FInd Examples).  You should perform a loopback test at least to verify that the hardware is working as expected.

 

Omishra, in order to get better attention for your questions, it would have been better to post your question in a new thread since this thread is old and your question is not related to the thread (other than using modbus).

 

What hardware are you using?  What version of the drivers?  Which LabVIEW version? 

 

I would reccommend posting your question and the answers to these questions and what troubleshooting steps you have tried on a new thread.

Systems Engineer
SISU
0 Kudos
Message 5 of 5
(5,540 Views)