Thang Nguyen Posted July 18, 2008 Report Share Posted July 18, 2008 Hi, I have a DSC Modbus server which includes some Shared Variables. I tried to use the event register to catch the event which if one shared variable is changed value. What I did is in the picture. But if one shared variable in one type of register is changed value (for example 10004), all of the remain shared variable in the same type of register generate the event even their values are not changed at all? I don't know how to separate the one which really change the value form the event. I don't want to use the method of comparing the new value with the value stored in shift register based on some reasons. Please tell me how to solve this issue. Thank you, Thang Nguyen Quote Link to comment
Thang Nguyen Posted July 18, 2008 Author Report Share Posted July 18, 2008 I think I should use front panel data binding. Quote Link to comment
LAVA 1.0 Content Posted July 18, 2008 Report Share Posted July 18, 2008 QUOTE (Thang Nguyen @ Jul 16 2008, 07:41 PM) Hi,I have a DSC Modbus server which includes some Shared Variables. I tried to use the event register to catch the event which if one shared variable is changed value. What I did is in the picture. But if one shared variable in one type of register is changed value (for example 10004), all of the remain shared variable in the same type of register generate the event even their values are not changed at all? I don't know how to separate the one which really change the value form the event. I don't want to use the method of comparing the new value with the value stored in shift register based on some reasons. Please tell me how to solve this issue. Thank you, Thang Nguyen http://lavag.org/old_files/monthly_07_2008/post-7703-1216251313.jpg' target="_blank"> Isn't there a "previous value" property to which you can make your compare? Ben Quote Link to comment
Thang Nguyen Posted July 18, 2008 Author Report Share Posted July 18, 2008 QUOTE (neB @ Jul 17 2008, 01:37 PM) Isn't there a "previous value" property to which you can make your compare?Ben There is not this property. I tried to use the front panel data binding, but these shared variable control didn't generate the event when they are changed value through the modbus. I stuck T_T Quote Link to comment
LAVA 1.0 Content Posted July 19, 2008 Report Share Posted July 19, 2008 QUOTE (Thang Nguyen @ Jul 17 2008, 06:11 PM) There is not this property.I tried to use the front panel data binding, but these shared variable control didn't generate the event when they are changed value through the modbus. I stuck T_T Yup! you are correct. Then query this shared variable history based on the shared variable value returned by the event. Can anyone think of a better approach? Ben Quote Link to comment
Thang Nguyen Posted July 19, 2008 Author Report Share Posted July 19, 2008 QUOTE (neB @ Jul 17 2008, 06:00 PM) Yup! you are correct.Then query this shared variable history based on the shared variable value returned by the event. Can anyone think of a better approach? Ben I think about storing the values in a shift register and compare with new value to find out which one is a change value one. Quote Link to comment
TechNick Posted August 11, 2008 Report Share Posted August 11, 2008 If you're just concerned about getting an event on the one Modbus register you can use the 'DataSocket Read' VI in blocking mode. This function will return a value only when the Modbus register changes or upon a timeout. To get the desired behavior you would create a separate while loop that uses DataSocket Read to monitor the tag then generate a user event for your main loop if the data changes. You can get at the Modbus register using a 'psp://...' URL. -Nick Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.