Setting 0-5 Volt Output On Modbus Tcp


idonotknowmuch

Recommended Posts

Hello,

 

I am using Daq Factory combined with Modbus TCP Crevis FnIO series I/O modules to set up a basic process where valves and pumps are controlled from a HMI screen built in Daq Factory. I am using digital output modules to control the solenoid valves and to control the relays to switch the pumps on/off. I am also a using 0-5V output module to control the pump speed.

 

So far I have managed to control the valves and switch the pump on and off by addressing the I/O modules, converting the Output Bit hex address to decimal, creating channels and then using the Force Coil Function on these channels.

 

However I cannot get the pump speed to be controlled by the 0-5V output module. I have tried using the same approach by converting the Output Bit hex address to decimal, creating a channel and then using the Set Register S/U16 Function. The technical manual for this unit provided the following table for relating hex to voltage which I then converted to decimal and set the channel to the decimal value using a variable value.

Voltage 0V 2V 4V 5V Data(Hex) H0000 H0666 H0CCC H0FFF

 

The modules also have an Output Word hex address which is different to the Output Bit hex address and I was wondering if this was the address I should be using. However when I tried this it also did not work. I also tried swapping the functions from Set Register S/U16 to some of the other options, but that did not work.

 

I am completely new at programming and software and have been using the manuals and forum combined with a lot trial and error so I was wondering if there is a very basic or simple mistake I am making? I apologize if this is a bit of a simple question.

 

I will also try measuring the voltage output from the module just in case the cause of the problem is not related to the software and module but is actually related to the wiring of the pump.

 

Any help or advice would be great.

 

Thanks.

Link to comment
Share on other sites

You want Set Register U16.  The output is a 12 bit analog output, so 0 = 0V, and 4095 = 5V, and it scales in between.  You can create a conversion for your channel to do this math for you:  Value / 5 * 4095.

 

But you need to figure out which register it is.  You definitely don't want to bit register numbers.  You'll want the Word address.  But you'll need to convert to decimal.  After that, there is sometimes an off by one error in the way manufacturers document their Modbus registers (I swear, many manufacturers really don't understand Modbus....)  So try subtracting 1 or adding 1 to the number you come up with.

 

Otherwise, post the manual or a link for the manual for the device.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.