LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

1766 BWAA PLC - Labview interface acting really strange

Solved!
Go to solution

Hi all,

 

This is a very,very strange response I am getting.

 

I have a 1766-BWAA PLC controller with which I am communicating via modbus. 

one AIN, one DOUT and one DIN module is connected to the PLC.

 

when I control the PLC using Modscan -coil status, input status, input register - I am able to control the PLC. I can read/write coils, read AIN modules, read DIN module. This is why I think the problem might be with Labview.

 

but when I try to do the same thing with Labview, I am getting only the DOUT part right. AIN and DIN are giving me strange response. Below is the situation.

 

AIN Module: I have connected a source meter to AIN. I give the source alternately to channels 0-4. but the labview program reads the PLC register only if i read using modscan once. So the sequence for AIN detection in Labview  is(!), apply 1V to AIN0, run modscan,  run labview. apply 2v to AIN0, run modscan, run labview. Now the current value and previous value appears in the labview alternatively. the period of this fluctuation is 5. (the reading that i  get will be AINvalue for 1V, junk, junk, AIN value for 2V,junk and this cycle repeats. strangely, its always 5 iterations.)

 

Same situation with DIN. If I want the value in Labview, I have to read in modscan once. Its as it labview is following modscan. 

 

this is bizarre. I am not able to figure out why thi is happening. vi that i used for reading PLC is attached.

 

Any help will be appreciated.

 

0 Kudos
Message 1 of 2
(2,117 Views)
Solution
Accepted by topic author pcs82

Hi,

 

The problem has been solved with adding an MBAP header to the Query vi.

 

Regards.

0 Kudos
Message 2 of 2
(2,088 Views)