2 device conflict?


steveandrews

Recommended Posts

Hi,

I'm having some issues I think with a conflict between 2 devices. I thought it was an electrical issue but i am now pretty sure it is daqfactory.

I have a usb to rs232 connected to a flow controller and use a custom protocol to poll it via the virtual comm port as per the instructions in the manual, driven by 1 channel at a timing of 1 sec and add the parsed data to channels. This works great. I also have an arduino chip built into my embedded computer that is running a modbus protocol (although the chip is built in to the board, i think it also runs a usb to serial adapter chip). This also works great and i use a sequence to read some registers and put them in channels. To write to some registers i just use the modbus commands on the channel and set the channel. 

The problem I am having is that if i switch some valves on/off by setting the registers, sometimes the RS232 adapter to the flow controller will drop out and i have to unplug in order to then initcom(). I get a timing lag error. I think what is happening is maybe if the writing to the modbus registers happens at the same time as the channel timing talking to the flow controller, the flow controller comm port gets locked up somehow? I'm not sure if this is an accurate diagnosis. The modbus read doesn't seem to be affected but it is in a sequence with a try catch.

I tried reading the flow controller in the sequence with the modbus, with both reads from the modbus and the flow controller on a 1 sec loop with 0.5 sec offset. They both have try catch and the data comes in fine. But writing rapidly to the modbus I can still get the flow controller to drop out. I was thinking to move the writing to modbus into the sequence also, so I can be sure it never sends data at the same time as the reads but I'm wondering if i'm going about this all wrong!? I don't understand how the two different devices can affect each other like this as it's a different device, different protocols and different ports???

Any ideas would be great

Cheers

Link to comment
Share on other sites

Ooops! just figured out that it's the collapsing magnetic field in the solenoids that's causing it. 

It's odd because they are on a separate power supply and energised by relay boards with all the right diodes etc. Somehow the signal is getting back through the power lines of the embedded computer and causing no other problems except dropping the usb-rs232 to the flow controller. The one to the arduino chip that actually controls the valves seems unaffected! 

So ignore my question about device conflict, have tested it and the communication part is rock solid

Cheers

Link to comment
Share on other sites

Yeah, that's why I'm not a big fan of USB-RS232, or for that matter, anything USB.  Its too susceptible to power issues and other devices on the bus.  I prefer real serial ports, or if not available using Ethernet to serial converters.  Yes, they are more expensive, but more reliable.  They also don't require any special software be installed on the machine, at least the SeaLevel ones, as DAQFactory can communicate directly to their RAW port over Ethernet even using ModbusRTU which is traditionally not an Ethernet protocol.

Link to comment
Share on other sites

Archived

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