Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Error writing value to field
#1
This is my first trigger attempting to set a value of a field to a value from another field & I get the error "Cannot convert the passed value to a form legal for field <target field>."

I am attempting to take the value from OpenWeather ( WEATH#curTemp [Type: MEng.Int4]) and write it to the outside temp of my RCS serial thermostats (Main_OutsideTempStat [type: MEng.INT4]).


I am able to type a value in the driver directly & have it write to the thermostat correctly, but I cannot get the action of the trigger to work.  I'm really new to CQC, but is there some form of typecasting that I need to do?

Thanks
Reply
#2
(05-26-2021, 05:04 PM)Spot Wrote: This is my first trigger attempting to set a value of a field to a value from another field & I get the error "Cannot convert the passed value to a form legal for field <target field>."

I am attempting to take the value from OpenWeather ( WEATH#curTemp [Type: MEng.Int4]) and write it to the outside temp of my RCS serial thermostats (Main_OutsideTempStat [type: MEng.INT4]).


I am able to type a value in the driver directly & have it write to the thermostat correctly, but I cannot get the action of the trigger to work.  I'm really new to CQC, but is there some form of typecasting that I need to do?

Thanks
What is the trigger?  Is it any field change for a value from WEATH#curTemp?

Can you provide the actual FieldWrite command you have in the trigger?  Just want to make sure you are taking the value from the curTemp and not the text of the name.  For example, you should be passing the value from the openweather field to the RCS, and it requires the $() to pass a value.

Devices::FieldWrite
    P1= Thermo.OutsideTempStat
    P2=$(OpenWeather.WEATH#curTemp)
    P3=False
Reply
#3
(05-26-2021, 11:15 PM)kblagron Wrote:
(05-26-2021, 05:04 PM)Spot Wrote: This is my first trigger attempting to set a value of a field to a value from another field & I get the error "Cannot convert the passed value to a form legal for field <target field>."

I am attempting to take the value from OpenWeather ( WEATH#curTemp [Type: MEng.Int4]) and write it to the outside temp of my RCS serial thermostats (Main_OutsideTempStat [type: MEng.INT4]).


I am able to type a value in the driver directly & have it write to the thermostat correctly, but I cannot get the action of the trigger to work.  I'm really new to CQC, but is there some form of typecasting that I need to do?

Thanks
What is the trigger?  Is it any field change for a value from WEATH#curTemp?

Can you provide the actual FieldWrite command you have in the trigger?  Just want to make sure you are taking the value from the curTemp and not the text of the name.  For example, you should be passing the value from the openweather field to the RCS, and it requires the $() to pass a value.

Devices::FieldWrite
    P1= Thermo.OutsideTempStat
    P2=$(OpenWeather.WEATH#curTemp)
    P3=False
Reply
#4
Nothing was added on your last post, so hope you got it figured out. With this forum, sometimes it's better to not use the "reply" where it quotes everything, as it can get quite confusing if it is a long quote.
Reply
#5
(05-27-2021, 10:42 PM)kblagron Wrote: Nothing was added on your last post, so hope you got it figured out.  With this forum, sometimes it's better to not use the "reply" where it quotes everything, as it can get quite confusing if it is a long quote.

My apologies, I saw that my response had posted, but I failed to ensure that my message content was there...

Your solution worked perfectly.  Using the $([fieldname]) put the correct value into the field and it has been working without issue.  

That wasn't exactly the behavior I expected, but I'm wondering if I missed something in my perusal of the documentation.  

Thanks
Reply
#6
The $(driver.field) syntax works in any action parameters. But you can also use the Devices::ReadField and Devices::ReadField2 action commands to read the values into a variable. The latter can be useful for a couple reasons. One is that you don't have to read it multiple times if you need to use it multiple times. And the other is that those action commands can be fault tolerant, i.e. you can react to not being able to read the field and do something, whereas the $(x) form will always cause the action to fail if the field value is not available.

This section of the help on token replacement covers the details:

https://www.charmedquark.com/Web2/CQCDoc...eplacement
Dean Roddey
Explorans limites defectum
Reply
#7
Dean,

Thanks for the information and the link.  I am sure as I progress, it will become intuitive, but for now it really helps to have the support of the forum.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Dune driver wait for config error ellisr63 44 10,669 11-28-2019, 06:35 PM
Last Post: ellisr63
  CQC error installing on server 2016 zane 3 1,744 05-28-2019, 12:07 PM
Last Post: zane
  Timed Field Change in Lutron HW8 avtexan 11 5,237 08-06-2018, 11:17 AM
Last Post: Dean Roddey
  Install Error []dll is missing ControlFreak 2 3,143 11-05-2017, 02:18 PM
Last Post: ControlFreak
  ELK V2 Driver - AreaArm field & Triggers? sic0048 4 3,625 08-19-2017, 04:46 PM
Last Post: Dean Roddey
  Installation Error - dll missing znelbok 1 2,280 04-14-2017, 01:35 PM
Last Post: Dean Roddey
  itunes error every 5 seconds indygreg 3 2,720 01-03-2017, 03:45 PM
Last Post: Dean Roddey
  Installation error, missing file George M 1 2,262 10-23-2016, 04:31 PM
Last Post: Dean Roddey
  How to pass a variable into a field moniker EST 3 2,370 08-30-2016, 11:01 AM
Last Post: EST
  EventGhost alternatives to getting driver/field *TO* SmartPhone? IVB 37 13,762 08-13-2016, 07:32 PM
Last Post: IVB

Forum Jump:


Users browsing this thread: 1 Guest(s)