Results 1 to 4 of 4

Thread: Can I pass include variables in the Serial Send?

  1. #1

    Default Can I pass include variables in the Serial Send?

    I am currently controlling my preamp via the Girder 4 serial send funtion. I have a lua definitinon for the preamp and all of the functions work properly. I just found out that I can display text over the OSD via the preamp's serial connection as well.

    If I send the following to the preamp using the serial send, "test" is displayed:

    P1z1test

    So...If girder picks up an X-10 command on say the garage motion sensor, I send the command P1z1Garage Motion via the serial send, and "Garage Motion" shows up on my projector. I would like to be able to display the real time weather data that girder is gathering. Is it possible to some way include a variable in the commandline for the serial send. I can't seem to get it to work...so I am guessing no...as I have tried P1z1Weather.Local.ForecastConditions.Description but that didn't seem to work. Is it possible to do it this way? If not, can someone assist with a script to send the P1z1"textgoeshere" so I could include variables in the text?

  2. #2
    Join Date
    Jan 2005
    Location
    Mercerville, NJ
    Posts
    22

    Default

    Unfortunately, the “Serial Send” is quite rudimentary and I don’t believe that it can take variable arguments.

    However, this is quite possible but it’s a little more advanced. Use “scripting” instead of “Serial Send”. A simple send will look like this:
    <device>:SendCommand ("P1z1" ..<pldx>)

    <device> is the name of your serial device. This will be the name that you gave it when you set it up (and the same as in Serial Send). It is case sensitive.

    <pldx> valid values are pld1 through pld4. These are the variable payloads that are passed from the event trigger. This will only work if you are sending the text in the payload with the event trigger.

    So an actual command would look something like this:
    MyProjector:SendCommand(“P1z1”..pld1)

    Hope this helps.

  3. #3
    Join Date
    Jan 2005
    Location
    Mercerville, NJ
    Posts
    22

    Default

    BTW, if you were trying to do the weather example off of a command rather than with an event trigger it would look like this:

    MyProjector:SendCommand(“P1z1”..weather.Local.fc[1].Description)

  4. #4
    Join Date
    Dec 2001
    Posts
    11,560

    Default

    you can send variables by enclosing them in []

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •