Logging in W2

Discussion in 'C-Bus Wiser 2 Controller' started by znelbok, Dec 14, 2017.

  1. znelbok

    znelbok

    Joined:
    Aug 3, 2004
    Messages:
    1,151
    Likes Received:
    17
    I have put int some code and it appears to be working fine, but there have been a few slight issues that I am struggling to trouble shoot.

    Is there a way to log?

    I have used the WriteLn function but that's not supported - so its fine when in PICED but obviously I cant download until I remove it.

    I want to log somehow to track whats going on.

    Is there also a way to stop the logic engine on the Wiser? If I am running logic on PICED how does the system not compete with the logic running on the wiser at the same time?
     
    znelbok, Dec 14, 2017
    #1
  2. znelbok

    Ashley

    Joined:
    Dec 1, 2005
    Messages:
    1,524
    Likes Received:
    173
    Location:
    Adelaide, Australia
    The Wiser has no inbuilt logging capabilities.

    If you can't run your logic in PICED long enough to show the problems there are a couple of things you can try in the Wiser:

    Open a TCP server socket in the initialization section, then connect to it via HyperTerm or equivalent. Then you can write text to the socket whenever you want. This is what I do. If you are really keen you can write your own LogMessage function that check where you logic is running and either uses the built in WriteLN, or your socket.

    Create a number of extra groups, then just set them to various levels in the logic to track what is happening. Run the CBus diagnostic tool to log the activity.

    Having multiple devices running the same logic will give you all sorts of heart ache. There is no protection against this. Always stop the device when running PICED. For the Wiser that means disconnecting it from the network. Alternatively you can write some logic to stop itself (i.e. Issue a HALT command in response to some group address), To start it up again, just reboot it.
     
    Ashley, Dec 14, 2017
    #2
    Jeff likes this.
  3. znelbok

    znelbok

    Joined:
    Aug 3, 2004
    Messages:
    1,151
    Likes Received:
    17
    Thanks - thats a great idea about opening a port.

    It makes sense that running the same logic would be problematic. I am surprised that running logic in PICED while connected would not automatically stop the deployed logic. i like the idea of having a halt, but rebooting is a kludge. I was contemplating adding a group that just enables and disables each of the functions (or all of the functions) and then turn it back on to let it all run again. That way if there is ever a problem you can easily stop the logic without a reboot
     
    znelbok, Dec 14, 2017
    #3
  4. znelbok

    Ashley

    Joined:
    Dec 1, 2005
    Messages:
    1,524
    Likes Received:
    173
    Location:
    Adelaide, Australia
    I've never really fully understand the relation between Wiser and PICED. According to the help file:

    This should imply that they can't interact because the logic is always run in the Wiser. But if you create a new Wiser project in PICED that has no associated hardware and add some logic, it runs just fine. However, I have had other cases where certain functionality won't work until you transfer it to an actual Wiser unit. Go figure !

    Another option for debugging that occurred to me that I have used before is to create some UserSystemIo strings, place them via a widget then set their value in the logic whenever you need to show some status.
     
    Ashley, Dec 14, 2017
    #4
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.