reset virtual udp input

Einklappen
X
 
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge
  • J V
    LoxBus Spammer
    • 28.08.2015
    • 367

    #1

    reset virtual udp input

    Hello,

    I have an issue with a VI for udp packages.

    First the situation:
    My audio amplifier has an rs232 connection to a pc. On the pc, I have a software (Lorris) to forward the rs232 port to udp. On a status change (e.g. volume) the amplifier sends e.g. "@VOL:-40\r". As udp packets, this is split in 1,2 or 3 byte packages, e.g. "@VO", "L:", "-4", "0\r". I haven't found a way around this (suggestions are welcome, it also occurs when using lorris to forward to tcp and combine it with the loxberry plugin tcp2udp, just happens less frequently and only seems to start after querying the amplifier).

    But this brings me to my workaround and problem. I made 3 VI inputs (one for the first byte, one for the second byte and one for the third). My idea is to concatenate them (there is a wiki entry on text input to the miniserver) with subsequents blocks until \r is found. And this idea works... except for the fact that the VI's keep their value. The above example therefor concatenates "@VOL:O-4O0" as the block for the 3rd byte is always O.

    Can the error output of a VI help me here? Or is there away to reset the value of a VI? I cannot look for a change if value as I don't know for sure that it should change, and the timestamps of the values (<v.t> in status blocks) are not exactly the same for parts of the same message.

    Any ideas? Both on the udp thing or on getting the data from rs232 via something on pc to the miniserver...?

    Thanks,

    Jörg
  • Tico
    Lox Guru
    • 31.08.2016
    • 1035

    #2
    Zitat von J V
    Or is there away to reset the value of a VI?
    Yes, you can reset the value of a VI. The following logic might be adaptable for part of your problem.

    Background - A script running on a Loxberry pulls some data from a website and forwards it to the Miniserver as UDP. I wish to be informed if the process fails.

    The Miniserver Virtual Input registers a UDP value '1' when the process is successful. If the process fails, the value '1' would remain as it's last received value. That's not very helpful for my needs.

    Instead, after a short delay, a '0' is written back to the Virtual UDP input (note - any value could be written back depending on your requirements).

    The repetitive appearance of a '1' at the virtual input ensures that a Switch-Off Delay never times out.
    Ich spreche kein Deutsch. Gib Google Translate die Schuld, wenn ich unverständlich bin.

    Kommentar

    • J V
      LoxBus Spammer
      • 28.08.2015
      • 367

      #3
      Thanks for your reply!
      I was thinking of a loop back, but actually not in this context... Might work... but there is that each of the three virtual inputs can be used again immediately after: a single parsed command such as "@VOL:-44\r" could result in 3 times the use of the virtual inputs for the three bytes: if it gets split in "@VO", "L:", "-44", "\r", then this would trigger VI1,VI2,VI3, followed by changes of VI1,VI2, then VI1,VI2,VI3 and then VI1. There is no way of choosing a delay for resetting VI2 or VI3 that would not be too late (I checked the timestamps in the state block using v.t, some are the same).

      A workaround could be to use distinct inputs for each part, rather than recyling VI2 and VI3 but as I don't know how many parts there will be, there will be a lot (commands are limited in length though, so 10-15 or so should suffice). Then I could reset all inputs as soon as the value \r is seen (this finishes the command). However, some changes in the amplifier trigger multiple events (sequence sent to rs232) in rapid succession, so the loop back that clears the VIs may interfere with the next command that is coming... and the \r may be mixed in with the beginning of the next command (which would fail).

      Currently looking at a different way of converting the RS232: I have used eventghost in the past, and may try that one for passing the data in a way that would not require this weird construction in the miniserver... There is now a plugin for Denon that I can adapter from my Marantz... So it may be a more elegant solution...
      Zuletzt geändert von J V; 12.04.2020, 14:27.

      Kommentar

      Lädt...