FOUNDATION Fieldbus

cancel
Showing results for 
Search instead for 
Did you mean: 

DD Method for validating a "time value" data-type

    Hi !
    I have a "time value" parameter named set_date_time. This parameter alows the user to introduce a different date/time into my system.
    For historical reasons (there was a time when this data/time parameter was an octet string rather than a "time value") I also want to be able to have
    a DD method that allows the user to introduce the same information, this time by selecting the "Introduce new date" from a menu (the part with integrating
    this into a menu is no problem)

    By looking into the DD spec I saw that I could use "edit_device_value" prebuild method (I think it's still caled a method) to achieve this. What I want to obtain is of course
    a means for the user to get the same validation of the introduced date/time as is the case with using directly the interface to the parameter (when a box appears and there you can    
    see the required format yy/mm/dd and hh/mm/ss)

    Here is the method that does not work as expected:

 
   METHOD m_set_date_time
{
  LABEL "Set date time";
  CLASS OUTPUT & SERVICE;

  DEFINITION
  {
    long          status;
    unsigned long param_id;
    unsigned long member_id;

    unsigned long ids[1];
    unsigned long indices[1];
    long          id_count;

    id_count = 0;
    param_id = ITEM_ID(PARAM.SET_DATE_TIME);
    member_id = 0;

    status = edit_device_value("|en|Enter new date time:\n", ids, indices, id_count, param_id, member_id);

    status = send_all_values();
   }
}

The problem is that when you select the execution of this method in NI Configurator 3.1.1 you get an "text edit field" that does not impose any constraints or indication to the user as what he is supposed to introduce there.

Is there any way to be able to achieve this by using the methods and basing the validity check on the host system (NI Configurator)?

Thanks for your time !
   
0 Kudos
Message 1 of 3
(7,155 Views)

Hi George,

Thanks very much for your detail information.

I suggest that you can validate the input date value in DD file. If the input data value is out of range, Configurator will not display the value in date field.

For the DD related problem, you can also turn to Fieldbus forums, http://forums.fieldbus.org/. ThanksSmiley Happy

Feilian (Vince) Shen
0 Kudos
Message 2 of 3
(7,139 Views)
    Just hoped that some active user of this forum would take his time and suggest in some words what would be an alternative to do what I wanted Smiley Indifferent

George
0 Kudos
Message 3 of 3
(7,137 Views)