Logo
NGFC_LVDTRVDTTx_Demo

Demo program for LVDT/RVDT Tx IP Core.

The Usage() function shows how to execute the test program, options available and default values set for different configuration variables. The Variables section specifies variables used in the test program, what they specify, the values it holds and can take. The main() function specifies sequence of api calls executed and tested.

Functions

void LVDTRVDTTxUsage ()
 
int main (int argc, char *argv[])
 

Variables

double starting_angle =0
 Internal Excitation Starting Angle of the LVDT/RVDT Tx IP Core Channel rotation. It takes values 0 - 360 in degrees and defaults to 0 degree.
 
uint enable =1
 enable mode bit for the LVDT/RVDT Tx IP Core Channel. Toggling the enable signal will cause the registers to revert to default power-on states. It takes values 0 or 1 and defaults to 1
 
uint activate =0
 output enable for the LVDT/RVDT Tx IP Core Channel. Enable this after configuring the registers associated with api calls starting with C. It takes values 0 or 1 and defaults to 0
 
double frequency =0
 Internal excitation frequency for the LVDT/RVDT Tx IP Core in Hertz.
 
uint data_register_mode =0
 Data Register Mode takes values 0 or 1(0-signal input from port, 1-signal input from register) and defaults to 0.
 
uint excitation_mode =0
 Excitation Mode takes values 0 or 1 (0= internally generated excitation, 1= externally generated excitation applied through the input port) and it defaults to 0.
 
uint negate_output =0
 This will negate the three output ports vs1, vs2 and excitation out. This is accomplised by using a three bit parameter whereby LSB bit negates vs1, second bit negates vs2, MSB negates excitation out. It defaults to 0.
 
uint mode =1
 Mode indicates if the IP functions as RVDT or LVDT and takes values 1 for RVDT and 2 for LVDT respectively. It defaults to 1.
 
fpgawb_ipcore_t ip_core
 fpgawb_ipcore_t struct which stores useful information about the IP Core after executing get IP Info api call. Check fpgawb_lib.h or api call documentation for more information
 
int channel =-1
 Channel number for the LVDT/RVDT Tx IP Core Channel. It takes values 0 to (number of IP Core channels-1) and defaults to -1 (test program executed for all channels)
 
uint config_mode =0
 Configuration mode for the test program. Indicates to run the program in configure/setup IP mode or configure frequency/data on the fly mode. It takes values 0-Static configuration/1-Change Freq or data on the fly. It defaults to 0.
 
fpgawb_ipcore_lvdt_rvdt_tx_configure_t config
 fpgawb_ipcore_lvdt_rvdt_tx_configure_t struct passed as argument for setting the static parameters if the LVDT/RVDT Tx IP Core channel. Check fpgawb_lib.h or api call documentation for more information
 
double data = 0
 Data is the information input and takes value -1 to +1 on LVDT mode and data is the theta input in degrees and takes value -90 to +90 on RVDT mode. The data register mode should be set to 1 using the Configuration api call prior.
 
uint phase_delay = 0
 phase_delay is delay for vs1 and vs2 in 100ns increments up to max of 50.
 
double gain = 0.9999
 Gain is the amount to scale the output relative to the input. It takes value 0 to 31.
 

Function Documentation

void LVDTRVDTTxUsage ( )

Usage:
./fpgawb_ipcore_lvdt_rvdt_tx [-A Activate] [-b BoardNumber] [-c channelNumber] [-C config_mode] [-d DataRegisterMode] [-Data] [-e Enable] [-E ExcitationMode] [-f Frequency] [-g Gain] [-m Mode] [-n NegateOutput] [-p phaseDelay] [-s StartAngle]

Options Default value
-A Activate (0/1) 0
-b Board Number 0
-c channel Number (0-(Numchans-1) -1 (all channels)
-C Config Mode (0-Static Configuration/ 1-Dynamic Configuration) 0
-d Data Register Mode (0-Signal I/P from port, 1-Signal I/P from register) 0
-D Input Data +90 to -90 in degrees for RVDT mode and 32 bit signed integer -1 to +1 for LVDT mode 0
-e Enable (0/1) 1
-E Excitation Mode (0=internally generated excitation, 1=externally generated excitation applied through the input port) 0
-f Internal Excitation Frequency in Hz 0
-g Gain 0.9999
-m Mode (1-RVDT / 2-LVDT) 1
-n Negate Ouput negates the three output ports vs1, vs2 and excitation out. This is accomplised by using a three bit parameter whereby LSB bit negates vs1, second bit negates vs2, MSB negates excitation out 0
-p Phase Delay is delay for vs1 and vs2 in 100ns increments up to max of 50 0
-s Internal Excitation Starting Angle (0 degrees - 360 degrees) 0


Examples:
./fpgawb_ipcore_lvdt_rvdt_tx
./fpgawb_ipcore_lvdt_rvdt_tx -E1 -n3 -p3
./fpgawb_ipcore_lvdt_rvdt_tx -C1 -f1000
./fpgawb_ipcore_lvdt_rvdt_tx -C1 -D45

int main ( int  argc,
char *  argv[] 
)

Step 1: OPEN DEVICE
ccrtNGFC_Open(&handle,board_no,oflags)
Before using any API calls, the user needs to open the device and get a handle. This handle is then used as the first argument in most of the following APIs.

Step 2: GET DRIVER INFO
ccrtNGFC_Get_Driver_Info(handle, &binfo)
This call returns useful driver information and saves in the ccrtNGFC_driver_info_t structure for later use.

Step 3: GET LIBRARY INFO
ccrtNGFC_Get_Library_Info(handle, &linfo)
This call returns useful library information and saves in the ccrtngfc_library_info_t structure for later use.

Step 4: GET IP INFO
fpgawb_LVDT_RVDT_Tx_Get_Ip_Info(handle, &ip_core)
This call returns useful IP Core information and saves in the fpgawb_ipcore_t structure for later use.

Step 5: ACTIVATE LVDT/RVDT TX CHANNEL
fpgawb_LVDT_RVDT_Tx_Activate_Ch(handle,chan,enable,activate)
This call activates the LVDT/RVDT Tx IP Core Channel. Note to set activate to 0 because we will be using the Config api calls which requires activate be 0. The default for activate is 0 in this test program. It is set to 1 at the end. Please be careful to give in the value as 0 when running the test program.

Step 6: CONFIGURE CHANNEL
C_fpgawb_LVDT_RVDT_Tx_Configure_Ch(handle,chan,&config)
This call configures the static parameters like data_register_mode, excitation_mode, phase_delay, gain, starting_angle, negate_output and mode for LVDT/RVDT Tx IP Core Channel.

Step 7: ACTIVATE LVDT/RVDT TX CHANNEL
fpgawb_LVDT_RVDT_Tx_Activate_Ch(handle,chan,1,1)
This call activates the LVDT/RVDT Tx channel for Running after the configuration phase. Note that you set the activate to 0 before configuration so make it 1 now.

Step 8: WRITE LVDT/RVDT TX CHANNEL DATA
fpgawb_LVDT_RVDT_Tx_Write_Ch_Data(handle,chan,data)
This call writes data to the input data register of the LVDT/RVDT Tx IP Core Channel, if the Data register mode is set to 1 via the configure api call.

Step 9: SET CHANNEL PHASE INCREMENT
fpgawb_LVDT_RVDT_Tx_Set_Ch_Frequency(handle,chan,frequency)
This call sets the Internal Excitation Frequency in Hz for the LVDT/RVDT Tx IP Core Channel.

Step 9: CLOSE DEVICE
ccrtNGFC_Close(handle)
Closes the device with the handle.