FOUNDATION Fieldbus

cancel
Showing results for 
Search instead for 
Did you mean: 

Menus

I am trying to create methods and use the NI Configurator 3.1.1 to display them.

I cannot seem to make any menus appear.

If I declare a Method, it appears under the NI 'Methods' menu, but I get an interpreter error.

 

When I run the method, I get this:

-------------------------------

Method interpreter runtime error

Error: Line 4: Undeclared identifier "_l"

Method execution did not complete

Method execution has halted

-----------------------------------------

Can you give me any ideas as to what I may be doing wrong?

0 Kudos
Message 1 of 15
(10,616 Views)
Hello,

This error is reported by DDS (Device Description Service). A simple way to verify it is to run this method in DD Super Viewer, it should have the same behavior. To solve this problem, please refer to the following documents from Fieldbus Foundation. They should be installed with the Tokenizer and they could help you in the details for sure.
--Device Description Implementer's Guide
--Method Development Guide

Please be aware that, if you use METHOD_ITEMS in the block's definition or use REDEFINE METHOD_ITEMS in the block's redefinition to refer some methods, NI-FBUS Configurator will use a "Method" menu to group all these methods. Another way is to show the method in the customized menu. The attached file shows an example.

If there is still problem, would you please send me the whole DDL file?

Hope it help and please feel free to let me know if I could do more help for you!



Josiane Zhou
National Instruments
Product Support Engineer for NI-FBUS

Message Edited by Josie on 10-18-2006 07:29 AM

0 Kudos
Message 2 of 15
(10,607 Views)
I have attached the ddl source for the problem I initially mentioned.
 
The  MENU_ITEMS are under the block lx_xd_block.  The actual definitions of the menus and method are listed below.  They are from XDMethods.ddl which is a #include in the main ddl file.
 
-----
/*************   Menus and Methods **
    **** maybe in separate file??? ******/

MENU    device_root_menu_xd
{
    LABEL   "|en|  Logix XD Wizard";
    ITEMS
    {
       mn_status (REVIEW),
       mn_setup (REVIEW),
       read_final_value
    }
}
              
MENU    mn_status
{
    LABEL "|en|Status ";
    ITEMS
    {
        PARAM.FINAL_POSITION_VALUE.VALUE
    }
}
MENU    mn_setup
{
    LABEL "|en|Setup ";
    ITEMS
    {
        PARAM.VALVE_SN
    }                  
}

METHOD read_final_value
{
 LABEL "Read Final Value.";
    CLASS   OUTPUT & SERVICE;
 DEFINITION
 {
     long   status,lstat;
     unsigned long id;
     unsigned long index;
     float  fltval;
     id = ITEM_ID(PARAM.FINAL_POSITION_VALUE);
     index = MEMBER_ID(VALUE);
     status = get_float_value(id,index,&fltval);
     lstat = display_builtin_error(status);
 }
}
 
 
------
 
 
 
I've also attached a couple screen shots of what I saw.
 
 
J.
 
Download All
0 Kudos
Message 3 of 15
(10,594 Views)
I cannot tokenize the DevwithMethods.txt, so I create a simple DDL file (menu.DLL in the attachment) and put the menu and method items into it. I changed the definition of FINAL_POSITION_VALUE, because I cannot find the status_contained_nvr and float_contained_nvr. The menus work well as shown in the attached image file.

As to the method, please check the "status" value before you call display_builtin_error(). For example:
status = get_float_value(id,index,&fltval);
if (status != BLTIN_SUCCESS)
{
lstat = display_builtin_error(status);
}

Hope it helps!

-----------------------------------
Josiane Zhou
National Instruments
Product Support Engineer for NI-FBUS

帖子被fieldbus在10-20-2006 05:08 AM时编辑过了

Download All
0 Kudos
Message 4 of 15
(10,577 Views)
Simulator Example:
 
I built the new DDs as outlined in the readme.
The only change was that I had to change the imported DD_REVISIONS, since I have standard library 2.0.  When I load it into the Offline Interface, I always get this error:
 
 
NIF_ERR_OFFLINE -- Offline NI-FBUS error (Error Code = -256).
 
Any suggestions?
I've attached my modified version of the ddl source.
 
J.
 
 
0 Kudos
Message 5 of 15
(10,562 Views)
Sorry, I verified the previous DD with NI-FBUS 3.2 only. If we use previous version of NI-FBUS software, we need to do some changes. On the other hand, please be aware that NI-FBUS 3.1.1 supports DDS 4.2, while NI-FBUS 3.2 supports DDS 5.0.5. So please pay attention to both the NI-FBUS version and the tokenizer version.

Attached is the latest DD/CFF file which is verified with NI-FBUS 3.1.1.

For your information, evaluation software of NI-FBUS 3.2 could be found through the following link, which has better performance and better error tolerance. The offline operations are available within this version.
http://digital.ni.com/softlib.nsf/websearch/F8F368E7A6563319862571E600140826?opendocument&node=132060_US

Hope it helps!

--------------------------------
Josiane Zhou
National Instruments
Product Support Engineer for NI-FBUS
Message 6 of 15
(10,551 Views)
I'm trying to get my methods to work in NI Configurator v3.2 and I get an error when I use the get_acknowledgement() or display_message() builtins.  For example, the following method results in the following error when it's run.
 
METHOD reset_mass_total
{
    LABEL "Reset Mass Total v12" ;
    HELP  "This method resets mass total to 0";
    CLASS OUTPUT & DIAGNOSTIC ;
              
    DEFINITION
    {
        unsigned long   id;
        long            status, status2;
 
        id = ITEM_ID(PARAM.RESET_MASS_TOTAL);
        status = put_unsigned_value(id,0,1);
        Abort_On_Builtin_Status_Error(status);
        status = send_value(id,0);
        Abort_On_Builtin_Status_Error(status);
 
        get_acknowledgement("Mass Total has been reset to 0", 0, 0, 0);
    }
}

----------------------------------------

Reset Mass Total v12

----------------------------------------

-------------------------------------------------

Method interpreter runtime error.

Error: Line -1:

Method execution did not complete.

Method execution has halted.

-------------------------------------------------

If I comment out the get_acknowledgement() builtin, the method runs fine.  Do I have to do anything special to display messages?

Dawn

 

0 Kudos
Message 7 of 15
(10,478 Views)

For what it's worth, I have found that builtins like display_message and get_acknowledgement seem to work if you declare both id and index as long and assing either or both to 0, when there is no actual id or index, then reference them when callin g the builtin.  I don't know why, but it worked on 3.1.1.  I don't have access to 3.2

 

 

0 Kudos
Message 8 of 15
(10,473 Views)

I tried defining id and index and it didn't help.

METHOD reset_mass_total
{
    LABEL "Reset Mass Total v14" ;
    HELP  "This method resets mass total to 0";
    CLASS OUTPUT & DIAGNOSTIC ;
              
    DEFINITION
    {
        unsigned long   ids, indices;
        unsigned long   id;
        long            status, status2;

        id = ITEM_ID(PARAM.RESET_MASS_TOTAL);
        status = put_unsigned_value(id,0,1);
        Abort_On_Builtin_Status_Error(status);
        status = send_value(id,0);
        Abort_On_Builtin_Status_Error(status);

        ids = 0;
        indices = 0;
        get_acknowledgement("Mass Total has been reset to 0", ids, indices, 0);
    }
}

0 Kudos
Message 9 of 15
(10,472 Views)
Both NI-FBUS Configurator 3.1.1 and 3.2 use the DDS (Device Description Service) of FF to interpret/execute the methods and then format/display the returned result. Version 3.1.1 uses DDS 4.2 while version 3.2 uses DDS 5.0.5, this might explain why "defining id and index" works in 3.1.1 but fails in 3.2.

I would like to suggest you ask FF for this issue. They could provide direct and detailed help for sure.
http://forums.fieldbus.org/

Hope it helps and please feel free to let me know if I could do more help for you!

-------------------------------
Josiane Zhou
National Instruments
Product Support Engineer for NI-FBUS
0 Kudos
Message 10 of 15
(10,462 Views)