LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Serial communication Modbus RTU between CPU and Speed variator

Solved!
Go to solution

Thank You RavensFan for your help.

Can you please tell me how can i make an algorithm  of this whole program, or just the reading part. For the communication we will just convert it in only one sentence " Open Communication & Close Communication ".

 

Start

...

Open Communication

...

Read register Value

...

Close Communication

...

End

0 Kudos
Message 11 of 13
(869 Views)

If all the menu parameters in a sequential set of modbus registers, you and reduce the communication load by using "Read Multiple Holding Registers".  You'll get an array of register values that you can then index apart into the various values.

 

If you have multipe registers that aren't in sequence, or different groups of registers, (like if you want to read menu 1's parameters, followed by menu 2', ....) you would need to do multiple reads.

 

For that overall architecture, what you have written is pretty good.  But at the part where you would "Read Register Value", or that might be multiple register values, you would put that into a loop.  Make an array of all the registers or groups you want to read.  Within the loop, index out each address, do the Write and Read, then send them to the appropriate indicators, or cells of the Excel spreadsheet.

0 Kudos
Message 12 of 13
(862 Views)
Solution
Accepted by topic author marocain93

I am pretty thankfull RavensFan,

However, i am only focused on the menu 0 and i don't know how to write the algorithm of this and how to send the values to excel, i don't know if i had to add the register of menu 0 to the diagram and front panel because now i'm only working in real time with the variator and i think that all the registers are there ..

I wrote some lines and i want the following  :

 

Start

Ressourne Name = Com1

Serial Type = RTU

BaudRate = 19200

Parity = none

Octect number = 1

Start bits = 1

stop bits =1

parametter adress = n

mode 1 = 16 bits

mode 2 = 32 bits

Open Communication

...

..

for n=0 to n<=59

Read value of parameter n

...

...

Close communication

..

End

0 Kudos
Message 13 of 13
(858 Views)