Walkerok Posted August 13, 2012 Report Share Posted August 13, 2012 V570, V1210, and a V1040 using Visi 9.4.0 build 0 and all of the latest firmware installed on any of the 3 I have an issue that came up because I have to write a program that will communicate with multiple VFD units, but I never know exactly how many and this necessitates a user enterable number of how many VFDs we will be talking to at the same time. In this case I made two lines for modbus reade (function code 3 with 98 reads per execution). On line one I let the read happen and in the first case I added after the read FB that if MI242 = 2 (two VFDs being read) then set MB 298. On the second line I have as a pre condition to execution that MI242 must equal 2 and imediately after the Read FB I reset MB 298. Each line is preconditioned as to wheather or not MB 298 is true or un-true. This seemed simple enough but on line one the setting of the MB 298 coil at the end never occured. If I forced the setting of the bit the second net would correcly reset the bit after executing the read to the second VFD. The only real difference between the lines was the camparison after the function code 3 read. I surmised that imediatly after the read the read is no longer true so that by the time the PLC got around to checking the comparison of MI242 the line was no longer true and the bit was never set. (Ok, I am mentally ok so far) So I removed the compare but I did not move the set MB 298 and just drew a connecting line to fill in the now empty spot. The result was unexpected in that the bit was again never set. Since line 2 worked correctly I decided to removed the line space between the read FB and the set MB 298 coil on net 1. Now the set coil workes correctly as needed. The result that the net did not work correctly till I touched the set coil to the read #3 FB was unexpected and I think indicates a bug in the compiler function of How Visilogic translates the graphical programming on screen to code that makes the PLC work. Just an FYI Thank You Keith Quote Link to comment Share on other sites More sharing options...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.