Ваши комментарии

Thank you for this - I looked into it and ended up making an Excel sheet which made the code for me. I have attached my project for your reference and JS below. It's a bit ugly, but I will test on Friday when i have a Samsung Display to control volume again.Level Test File

I am using a slider and writing the value (0-99) into a project token. I then read this token and call it 'samsungvolume.' Depending on the value (0-99) it will then send the correctly formatted command with checksum to the display to make the volume change when the slider is released.

var samsungvolume = null;
IR.AddListener(IR.EVENT_TAG_CHANGE, IR.GetVariable("Tokens.volume"), function(name,value)

{
samsungvolume = IR.GetVariable("Tokens.volume")

switch(samsungvolume) {
case "0": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x0,0x12'); break;
case "1": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x1,0x13'); break;
case "2": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x2,0x14'); break;
case "3": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x3,0x15'); break;
case "4": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x4,0x16'); break;
case "5": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x5,0x17'); break;
case "6": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x6,0x18'); break;
case "7": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x7,0x19'); break;
case "8": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x8,0x20'); break;
case "9": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x9,0x21'); break;
case "10": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x10,0x22'); break;
case "11": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x11,0x23'); break;
case "12": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x12,0x24'); break;
case "13": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x13,0x25'); break;
case "14": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x14,0x26'); break;
case "15": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x15,0x27'); break;
case "16": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x16,0x28'); break;
case "17": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x17,0x29'); break;
case "18": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x18,0x2A'); break;
case "19": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x19,0x2B'); break;
case "20": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x20,0x32'); break;
case "21": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x21,0x33'); break;
case "22": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x22,0x34'); break;
case "23": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x23,0x35'); break;
case "24": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x24,0x36'); break;
case "25": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x25,0x37'); break;
case "26": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x26,0x38'); break;
case "27": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x27,0x39'); break;
case "28": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x28,0x3A'); break;
case "29": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x29,0x3B'); break;
case "30": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x30,0x42'); break;
case "31": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x31,0x43'); break;
case "32": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x32,0x44'); break;
case "33": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x33,0x45'); break;
case "34": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x34,0x46'); break;
case "35": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x35,0x47'); break;
case "36": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x36,0x48'); break;
case "37": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x37,0x49'); break;
case "38": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x38,0x4A'); break;
case "39": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x39,0x4B'); break;
case "40": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x40,0x52'); break;
case "41": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x41,0x53'); break;
case "42": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x42,0x54'); break;
case "43": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x43,0x55'); break;
case "44": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x44,0x56'); break;
case "45": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x45,0x57'); break;
case "46": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x46,0x58'); break;
case "47": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x47,0x59'); break;
case "48": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x48,0x5A'); break;
case "49": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x49,0x5B'); break;
case "50": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x50,0x62'); break;
case "51": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x51,0x63'); break;
case "52": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x52,0x64'); break;
case "53": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x53,0x65'); break;
case "54": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x54,0x66'); break;
case "55": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x55,0x67'); break;
case "56": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x56,0x68'); break;
case "57": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x57,0x69'); break;
case "58": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x58,0x6A'); break;
case "59": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x59,0x6B'); break;
case "60": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x60,0x72'); break;
case "61": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x61,0x73'); break;
case "62": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x62,0x74'); break;
case "63": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x63,0x75'); break;
case "64": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x64,0x76'); break;
case "65": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x65,0x77'); break;
case "66": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x66,0x78'); break;
case "67": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x67,0x79'); break;
case "68": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x68,0x7A'); break;
case "69": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x69,0x7B'); break;
case "70": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x70,0x82'); break;
case "71": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x71,0x83'); break;
case "72": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x72,0x84'); break;
case "73": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x73,0x85'); break;
case "74": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x74,0x86'); break;
case "75": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x75,0x87'); break;
case "76": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x76,0x88'); break;
case "77": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x77,0x89'); break;
case "78": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x78,0x8A'); break;
case "79": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x79,0x8B'); break;
case "80": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x80,0x92'); break;
case "81": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x81,0x93'); break;
case "82": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x82,0x94'); break;
case "83": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x83,0x95'); break;
case "84": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x84,0x96'); break;
case "85": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x85,0x97'); break;
case "86": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x86,0x98'); break;
case "87": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x87,0x99'); break;
case "88": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x88,0x9A'); break;
case "89": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x89,0x9B'); break;
case "90": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x90,0xA2'); break;
case "91": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x91,0xA3'); break;
case "92": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x92,0xA4'); break;
case "93": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x93,0xA5'); break;
case "94": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x94,0xA6'); break;
case "95": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x95,0xA7'); break;
case "96": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x96,0xA8'); break;
case "97": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x97,0xA9'); break;
case "98": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x98,0xAA'); break;
case "99": IR.GetDevice("SamsungDisplay").Send('0xAA,0x12,0xFF,0x1,0x99,0xAB');

}
});


This has been a great help for me in implementing sliders for volume control. I am a little stumped with this when the product requires a checksum to also be sent. What would be the best way to insert the volume (i.e. 00 - 99) but then also calculate a checksum of part of the string to add at the end?

Thanks for this! The switches are currently in Layer 2 mode, however I did find a solution. I was able to segregate the Control Network and the DANTE Network (both virtual interfaces) from the single physical interface of the microphone by using MAC Based VLAN Groups. This way VLAN 1 is visible to iRidium Server and it can control the microphone, but DANTE is still segregated off to VLAN 4 for audio routing. This has worked extremely well. 

Thanks for the info. I am going to brush up on my Cisco networking and see if I can 'separate' via MAC address the two interfaces of the microphone so control can be on VLAN 1 for the iRidium server, and audio on VLAN 4 for DANTE. 

This worked beautifully - all my temperature values are updating across my panel projects when referencing the server token now - YAY!

Thanks for the response! It's after midnight in Sydney now so will try this when I get into work tomorrow.

The requests to the Hue Bridge are being conducted from the server. As it polls the bridge, I want it to put the returned value into a Server Tag/Variable which I can then display as text on a connected panel project. Would something like the following be more suitable?

//Get "temperature" number from motion sensor
// SENSOR 2 TEMPERATURE
var getTemperature = sensor2.state["temperature"];
var tempreadout2 = getTemperature.toString();
tempreadout2 = tempreadout2.slice(0,2) + "." + tempreadout2.charAt(2) + " ºC";
IR.SetVariable("ServerName.Tags.Lab1_Temperature", JSON.Stringify(tempreadout2));

Hi Vladimir

What is happening is that every 200ms I am requesting data from a Philips Hue Bridge 2.0. One of the items I am requesting is the temperature from a sensor. I want to be able to write that value into a Server Virtual Feedback which multiple Panel projects can then refer to for the sensor temperature. 

Hello

I am revisiting this project and still having issues. I am able to write the temperature value to a panel project text item, but I want to have this written to the server token I've created. I have been reading about IR.Log i.e. send the temperature to an IR.Log, then send that IR.Log to the server variable/token. How should I code that using the code above as an example? (tempreadout2 = the actual human readable temperature as 25.6ºC for example. 

Thank you for your help. The code works really well - it's a great snippet to build other ideas now:

IR.AddListener(IR.EVENT_ITEM_PRESS, IR.GetPopup("LabLink_Sources").GetItem("Receive_Lab1"), function()
{
var status = IR.GetVariable("Drivers.F10A-SERVER-01.LAB1-SIM");

if (status == 0)
{
IR.HideAllPopups("");
IR.ShowPopup("LabLink_Sources");
IR.ShowPopup("LabLink_NoAccess");
IR.Log("0");
}
if (status == 1)
{
IR.HideAllPopups("");
IR.ShowPopup("LabLink_Sources");
IR.ShowPopup("LabLink_Receive_Lab1");
IR.Log("1");
status = 0;

}
});


Сервис поддержки клиентов работает на платформе UserEcho