LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Modbus Help!

Solved!
Go to solution

So use this utility to set the output type of the chanels you wish to use.

And be done with the addresses 40200..... Never write to them again.

 

Advantech then must tell you what integer / word value in counts equates to what magnitude of enginerring unit on the output. Or you can find it out via experimentation.

You have stated previously that Modbus addresses 40001...etc are for setting the output value of a specific channel.

 

So between Modbus Poll, and Labview you should be able to write data to these registers. Either with function code 6 or function code 16 (Advantech should be able to tell what function codes their product supports - since they have conveniently left that out of the manual).

I suggest labview poll again because you can examine the frames to and from you slave and this can be quite helpful in determineing the issue. Although I have to beleive is it something simple like zero vs. one based addressing.

 

 

 

Message 21 of 30
(1,758 Views)

Hi,

 

For the ADAM utility it provides a slider to change the data. I need to change the data on both channel index 1 and channel index 2 (each have outut range +/-10V) before it allows the voltage change on my power supply.

 

Advantech utility does not provide any information on this matter i have been in contact again with them over it. With the modbus poll i select function 6, write a value 1,2 etc to the register 40001 with my slave address 6 and get a write error, if i send the same information again i get a timeout error. Shoud the value i put in be in hex or an 8 digit integer. This module is quite frustrating to understand. Thanks for the reply.

Download All
0 Kudos
Message 22 of 30
(1,755 Views)

Have you tried using a program like Portmon to sniff out what is happening on the serial port while using the ADAM program?

0 Kudos
Message 23 of 30
(1,746 Views)
Solution
Accepted by topic author Damien129

Hi Damien129

 

Hi do use a lot these ADAM, and from the images in your last post I see a problem.

 

In the Advantech Utility you have in the tree view listed the devices connected and I see this "4024(*)", this means that you have your 4024 in "programming" mode, you should switch to Normal mode the white switch you have in the module, instead of INIT.

 

This way you can communicate with it using the address you gave to it. Otherwise it's not possible, it won't work.

 

Message 24 of 30
(1,740 Views)

In the ADAM 4000 Manual You have this (the registers available for modbus)

 

5. ADAM-4024 4-channel Analog Output Module
ADDR 0X Channel Item Attribute Memo
00001 0 Emergency DI Input Flag R
00002 1 Emergency DI Input Flag R
00003 2 Emergency DI Input Flag R
00004 3 Emergency DI Input Flag R
ADDR 4X Channel Item Attribute Memo
40001 0 Current Output Value R/W
40002 1 Current Output Value R/W
40003 2 Current Output Value R/W
40004 3 Current Output Value R/W
40201 0 Type Code R/W
40202 1 Type Code R/W
40203 2 Type Code R/W
40204 3 Type Code R/W
40211
Module Name 1 R 0x40 0x24
40212 Module Name 2 R 0x00 0x00
40213 Version 1 R 0xa2 0x00
40214
Version 2 R 0x00 0x00
40215 Comm Safety Enable R Enable:0x00 0x01
40216
Comm Safety Flag R Occur:0x00 0x01
40221
Channel Enable R/W 0x00 0xff

 

 

Usually I use ADAM ASCII protocol, but actually i'm thinking on testing it with modbus to see if I can get faster response

 

You can try using ASCII Protocol

I'm sending a simple example I made to show how.

I hope it can help

Message 25 of 30
(1,736 Views)

Hi mgouveia

 

Thanks for the great advice you were correct the ADAM module was in the init state. I can now write and read without any errors and can communicate with my power supply. Very much appreciated thank you so much. 

 

Regards

 

Damien

0 Kudos
Message 26 of 30
(1,729 Views)

Hi mgouveia

 

Can you pl send the VI ADAM4024_SimpleWrite.VI in Labview 9.0 Version as i am not able to open the VI as it is of higher version.

 

I was searching for this code for a long time. 

 

Pl do the needful.

 

 

Thanks

 

CHAVAN 

0 Kudos
Message 27 of 30
(1,681 Views)

Here it is

 

This is just a simple example of how to do it. The same may apply for other ADAM4000 Family, you should read the manual to know which commands you should use to do a specific task, i think with this example you can see how to do it.

 

This one only changes one output channel

 

Message 28 of 30
(1,670 Views)

Thanks,

 

It is very useful VI for Our Application.

 

We have gone through the manual and with your VI in ASCII we are able to communcate with the module. 

 

Have you tried with MODBUS?

 

Once again i wold like to thanks you for your co-orperation.

 

Regards

 

CHAVAN

0 Kudos
Message 29 of 30
(1,661 Views)

Not yet. I will some day, when I have more time.

 

I'm using ascii, because I use most of ADAM4000 devices, and only some of them have modbus, so I have to use ascii for the others. That's why I prefer to use ascii mode.

 

Also, i think i can get more communication speed if I use ascii (with some tweaks).

 

Still I am researching for a way to improve the communication, because I usually have RS485 networks of more than 10 devices, and that's a pain in terms of timings, I have to read them sequentially to avoid data colisions.

0 Kudos
Message 30 of 30
(1,657 Views)