Home AMX User Forum NetLinx Studio
Options

Pass a STRUCTURE into a module?

2»

Comments

  • Options
    GSLogicGSLogic Posts: 562
    Joe Hebert wrote:
    Sure it will. As AMXJeff stated earlier:
    It works perfectly! Here?s an example where the main program or the module can alter the data and they will both stay in sync.
    Joe: nice job on the testMod! I use the saveToXML in my mods instead of the non-existing persistent variables.

    What I've been trying to say is: you can't use the variable in real time, you have to request their values everytime. Think about this, I want to create a module for a security system that needs to check if a TP is viewing that section, so everytime a zone trips I loop all the TPs, if one is on the security zone page, I update that touchpanel. I would have to request the VARIABLE_TO_STRING everytime a zone trips even if no TPs were viewing that section.
  • Options
    viningvining Posts: 4,368
    GSLogic wrote:
    so everytime a zone trips I loop all the TPs,
    Since you're problably handling page & pop up flips in and out of the security section somewhere in your main code outside of the security module I would think a better way would be to send a string to the module at the same time as the send_command for the page flip stating what TP just flipped in or out of the security section. Parse the string in the module and convert the string D:P:S to a D:P:S and use Daves combine/uncombine devArray function which he posted a while back to handle feeback to panels that are actively on a security page.

    Of course right now I just send it to every TP regardless but then again I'm not working on any mega TP jobs like you but if I were or if I had more time to do things right some thing like this would be very appropriate.
  • Options
    GSLogicGSLogic Posts: 562
    vining wrote:
    GSLogic wrote:Since you're problably handling page & pop up flips in and out of the security section somewhere in your main code outside of the security module I would think a better way would be to send a string to the module at the same time as the send_command for the page flip stating what TP just flipped in or out of the security section. Parse the string in the module and convert the string D:P:S to a D:P:S and use Daves combine/uncombine devArray function which he posted a while back to handle feeback to panels that are actively on a security page.
    I understand what you are saying and it is a good idea but, I also track many other things the TPs are viewing. I can look in my TP structure and see what section, menu, group, source, location and other preferences each TP holds. I use one TP design for all my TPs and use the prefs to change what each TP can view. I used to use the combine method years ago and changed to the DEV array approach since the panels can be more independent.
Sign In or Register to comment.