From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

FOUNDATION Fieldbus

cancel
Showing results for 
Search instead for 
Did you mean: 

reset vcr

I have a NI FBUS PCI card 2 channel, I need to clear the VCR buffer as I am limited to a maximum of 100 VCR per channel, How do I delete all previous VCR's on bot channels. Thank you

0 Kudos
Message 1 of 6
(6,642 Views)

The VCR information is stored in the MIB block of the device. You can use NI-FBUS C APIs to write zero to the VCR entries to clear the existing VCRs. Here is the procedures and pseudo-code. For more detail information about VCR structure, please refer to Foundation Fieldbus protocol specification.

 

 

  • nifOpenVfd(deviceDescriptor, "MIB", &mibDescriptor);  // Open MIB block using VFD tag "MIB"
  • VCR entries are the objects in MIB block. The names are VCR_STATIC_ENTRY.i . If the maximum VCR is 100, the names of VCR entries are VCR_STATIC_ENTRY.0 to VCR_STATIC_ENTRY.99. The size of each entry is 44 bytes.
        To clear existing VCR, you can write zero to all these entries.
        memset(buffer, 0, 44);
        err = nifWriteObject(mibDescriptor, "VCR_STATIC_ENTRY.i", buffer, 44);

 

Feilian (Vince) Shen
0 Kudos
Message 2 of 6
(6,625 Views)

Thank you Vince for the information, however even though your instructions are clear I do not know how to launch NI-FBUS C API. Is this a software package I need to download or is it included on the CD... Appreciate a response...

 

To further describe my issue is, I am using a NI- FBUS PCI card with tow channels, we use this card to test our production units, each time an instrument is connected to the card a VCR is logged, with the 100 VCR limit, each channel on the NI PCI card only allows me to test 99 units. I need a way for our production techs to clear this VCR buffer or log.

 

We have two test benches with 2 PCI cards, Bench #1 is dead because 198 instruments have already been configured and the VCR is full, and second bench has channel #1 ful and channel 2 is also about to be full as well, I cannot connect to a new FF instrument when the limit is reached.

 

Best Regards

 

Ohmart

0 Kudos
Message 3 of 6
(6,613 Views)

NI-FBUS C API is a library (nifb.lib) which can be called through your C/C++ program. You need to use Microsoft Visual C development environment to create your application and link these APIs.

 

For more detail information about how to use NI-FBUS C API, please refer to NI-FBUS Hardware and Software User Manual, Page 4-12, Write Your Application

 

The manual is located at Windows Start >> Programs >> National Instruments >> NI-FBUS >> Manuals.

 

Feilian (Vince) Shen
0 Kudos
Message 4 of 6
(6,595 Views)

Hello Vince,

 

I tried to use you code but got stuck at the 'memset' function.

I was using VB 6 and looked like this function didn't exist. 

Please help!!!!

 

ohmart

0 Kudos
Message 5 of 6
(6,583 Views)

The memset function in above pseudo-code just allocates a buffer array in which each element is zero. It is a function in C/C++ standard library. In VB, there is no need to do a memset. When declaring an array, all the elements will be initialized to zero by default.

 

NI-FBUS has VB API as well. The VB library and examples are located at <NI-FBUS installation directory>\NI-FBUS\MS Visual Basic.

 

 

 

 

 

 

Feilian (Vince) Shen
0 Kudos
Message 6 of 6
(6,560 Views)