PI controller with PCI 6251

Hi all,
I am using DAQ PCI6251. Can I use this card for creating PI controller ?
Basically, I think that we can analyze a PI controller into two phases, including the proportional and integral phases. I could do this easily with Labview library. But I am facing a difficulty how to build the saturation block for PI controller ?
Pls give me the solution.
Thanks so much for your helps and supports.
Best regards,
Duy

Dear Jochen,
Thank you very much for your reply.
I can describe what I am doing as follows:
I would like to control the induction motor drive system with vector control approach.
The equipments in my system include the induction motor drive system, inverter, PCI 6251 Labview card, block connector BNC2110. I am using Labview 7.1.
I will gather the stator currents and voltages from the induction motor under analog signals. Then I will make some calculations on Labview with available Labview library. After that I will output two analog signals. PCI 6251 has two analog signals. I will use two analog signals from PCI6251 Labview card as input signals for PWM generating board which I could bulid. This PWM generating board will create signals to trigger IGBTs of inverter. And the inverter will create signals to control the induction motor drive system.
In this drive system, we need to use two PI controller as the requirement of vector control approach.
I hope that my description is clear.
The expected sample rate is 10 kHz.
I am using XP Window OS.
I attach the diagram what I need to do as well.  
Thanks so much for your great ideas.
Best regards,
Duy
Attachments:
Practical_diagram_Labview_NI.pdf ‏27 KB

Similar Messages

  • Data acquisition and frequency generation togather with PCI-6251 and LV8.2

    Hi friends,
    I am a new user of Labview. I am using LB8.2 with PCI-6251 .
    I have to generate frequency and then measure the data and then for next frequency and so on.
    i know that for this i have to use looping and that is not a problem. The real problem for measurement is to identify whether the frequency is been generated. if yes then measurements starts otherwise it should wait until it started. then after finishing the measurements send a signal to generator for changing the frequency and amplitude.
    Now these two things {generation and measurement} togather are not working correctly for me. so i make 2 diff file, one for generation and other for measurements <by modifying the examples>. I can run both file togather and it works. But it need lots off effort and time. I have to measure from 10Hz to 1000Hz in 2Hz frequency step and i cannt leave in between .
    can anyone help me how to syncronize these two togather .
    Trying to attatch. both the files here ..
    main_v1.1.vi --> for Measuring
    Oscilloscope.vi --> for waveform generation
    Attachments:
    main_v1.1.vi ‏150 KB
    Oscilloscope.vi ‏37 KB

    Hay thnx dude..
    I found the example and now it works
    once again thanks a lot

  • Running LabView 7.1 with PCI-6251 in Windows 7

    I am very new to Labview, and would appreciate any assistance on this issue.  I was tasked with solving it and while I have made some progress I have now hit a wall.
    A computer with a PCI-6251 data capture card, some custom built (external) hardware and LabView 7.1 has been used for many years for a single, specific task, to do verification testing in a manufacturing environment.  The system works well and no additional features or functionality is required.
    The computer failed and a new one with a PCI card slot was purchased to replace it.  Of course as a new PC it has Windows 7 and hardware drivers for XP don’t exist.  I therefore need to run LabView 7.1 on Windows 7 with a NI-DAQ card.
    I installed the NI-DAQmx 9.5.1 driver and then installed LabView 7.1 (as discussed here).  The driver would not install if LabView was already installed since it gave the “unsupported on this version of windows error”.  MAX recognized the card, which it couldn’t when trying to use the 7.5 NI-DAQ driver.
    Now LabView opens but when I try to run the .vi used for testing it complains of 19 missing sub .vis which I cannot locate and I can’t find on the old computer to try to point LabView towards.
    I think something weird is occurring with trying to use the 9.5.1 driver with LabView 7.1.  Are there any suggestion or is there any advice on getting a PCI-6251 working with Labview 7.1 on a Windows 7 machine?   
    Solved!
    Go to Solution.

    After much greif and trying a half dozen various drivers with various settings and other ideas the following procedure based on Caraval's advice worked first time with no errors and seemingly no functional issues.  The system so far appears to be running in Windows 7 just as it was on Windows XP.
    1.  Install LabView from original install CDs, by opening the folder and right-clicking 'setup.exe' and clicking 'run as administrator'.  Selected 'do not install drivers' during the install procedure.  Rebooted computer.
    2.  Installed NI-DAQmx 8.9 from the self-extracting .zip file available here.  Shutdown computer.
    3.  Removed power, pressed power button to completely discharge power supply.  Installed PCI-6251 card.
    4.  Booted computer, and logged in.  Waited a long time, Windows eventually saw new hardware and installed drivers.  Verified MAX could see card.
    5.  Opened LabView and everything worked.
    Looks like we bought the system a few more years.  Will probably have to upgrade everything next time around though.  Many thanks to everyone who commented on this thread. 

  • Problems with Ethernet controller and PCI device driver on Satellite L30-10X

    Hellow!
    Sorry for my bad English, I'm from Russia.
    Just few days ago I bought Satellite L30-10X with W Vista on board. My opinion, that this OS does't very good on this computer, so I install W XP.
    I have some problems with drivers. At first, I dont know what model I have:PSL30 or PSL33? I download all drivers for both models. But, after installation, computer doen't find drivers for Ethernet controller and PCI device...

    Hi
    Satellite L30-10X belongs to the PSL33E series. This number can be found on the label placed on the bottom of the unit!
    You have to choose this number from the driver download form to get the compatible XP drivers.
    I dont know why you are not able to install the LAN driver. Ive got the same notebook with Vista and Ive installed the XP and all drivers run fine.
    I assume you have installed the drivers in wrong order. Please take the look in the Toshiba installation instruction txt file. In this order you have to install the driver! Its important.
    I think you should install the XP again to ensure the clean registry and then download and install the compatible XP drivers like mentioned in the installation instruction file.
    Good luck

  • How to generate a pulse of 5 V -ve polarity in synchronis​ation with a 10 v input using PCI 6251 DAQ board

    HI
    I want to generate a 5V -ve polarity pulse to trigger my IEEE 1394 camera using an PCI 6251 (scb68 pin E) device, furthermore I am reading a standard Vsync signal from a SVGA port which is 10 v.
    Now I want to synchronise the image capture of an IEEE 1394 camera with the Vsync signal so that camera is triggered to capture at every 4th Vsync signal (which is 50HZ.). Presently I am able to read the Vsync signal and also generate the -5 v signal But the Daq board generates a continues -5v signal while I want a 1 ms pulse (for every 4th Vsync).
    Also this 5 v signal is generated even if the vi is stopped running.
    Can anybody guide me so this problem can be solved.
    Thanks a lot in advance
    Shri

    You can use the Write function, that is you can use the 10 volt signal as a trigger for the task, and when you get this trigger, the task starts and generate (writes) a waveform you defined in an array ("data", in the example).
    Something like this..
    DAQmxCreateTask("",&taskHandle);
    DAQmxCreateAOVoltageChan (taskHandle, clokSource, your_sampling_freq, -10.0, 10.0,
    DAQmx_Val_Volts, "");
    DAQmxCfgSampClkTiming (taskHandle, clockSource, SAMPLING_RATE,
    DAQmx_Val_Rising, DAQmx_Val_FiniteSamps,
    samp_to_read);
    DAQmxCfgAnlgEdgeStartTrig (taskHandle, input_channel, DAQmx_Val_RisingSlope, 9.0);
    DAQmxWriteAnalogF64 (taskHandle, 1000, 0, 10.0,
    DAQmx_Val_GroupByChannel, data, //data contain a pulse
    &samp_per_channel, 0);
    DAQmxStartTask(taskHandle);
    // and then you create a loop....
    For example you can specify data to be like this:
    data[0] = -5;
    for(i=1;i<1000; i++){
    data[i] = 0;
    Tell me if you need more help.....
    bye

  • Using PCI-6251 with Labview 6.1

    I recently purchased a PCI-6251 multifucntion DAQ board to get a higher sampling rate than my old PCI-MIO-16E-4 board.  However I have existing software that I want to run on the new board.  The board came with NI-DAQmx which will only work with Labview 7 or above.  I am currently running NI-DAQ 6.9.3 and the Measurement and Automation program does not recognize the new PCI-6251 board.  Is there anyway to get Labview 6.1/NI-DAQ 6.9.3 to recognize and configure the new board?  Or will I be forced to upgrade my Labview?

    The M-series boards (PCI-62xx are M-series) require NI-DAQmx driver. The NI-DAQmx driver requires a newer Labview. No way around it.
    John Weeks
    WaveMetrics, Inc.
    Phone (503) 620-3001
    Fax (503) 620-6754
    www.wavemetrics.com

  • Problems booting from onboard SATA with PCI SATA controller installed

    I have a K7N2 Delta-ILSR motherboard (BIOS v 7.8), and my Windows XP installation is on a single drive attached to the onboard Promise 378 SATA RAID controller.  I have a PCI Promise TX2200 SATA RAID controller installed, currently in PCI slot 5.  The OS boots normally off the onboard controller if I do not have my RAID0 array attached to the PCI controller, but I get disk boot failure messages if I have the RAID0 attached to the Promise TX2200.
    I have tried putting the PCI controller in different slots to change IRQ channel routing, tried changing boot order in the BIOS, and even tried assigning specific IRQ priorities to the slot with the Promise TX2200.
    My basic question is this:  how do I get this motherboard to boot from the onboard controller while I have my RAID0 attached to the add-on PCI controller?

    Well, Promise got back to me.  They were insightful enough to tell me what I already knew and that they didn't support what I was trying to do:
    Quote
    Case Problem:   I have an MSI K7N2 Delta-ILSR Socket A motherboard with an onboard Promise FastTrack 376 SATA RAID controller. I wish to continue booting my OS from a single SATA drive on this controller, while using a RAID0 array on my FastTrack TX2200 controller. When the TX2200 is installed and the array is attached, it is detected as C: by the motherboard BIOS and the active boot drive as D:. The TX2200 is detected during boot (after POST) first, the onboard contoller second. I have tested the TX2200 in...
    Case Solution:   Hi Sorry for the late reply. Are you by any chance running both the FT 376 embedded controller along with the FT TX2200 if so than you will run into bios or driver conflict when both controllers in the system. Promise only recommend and support one cards pre system. Thank you.
    ... and MSI
    Quote
    Thank you for contacting MSI Technical Support.
    As onboard SATA controller and PCI controller are both promise. It exits compatibility between them. You could try the following procedures to check if they could solve the issue:
    1. Please contact the PCI card vendor to ask if there is relative firmware update
    2. Please disable all the onboard devices which you don't want to use in bios setup.
    3. You could try different MB bios version to have a check. You could download these versions from here.
    Please feel free to let us know if you still have any further issues or inquiries
    So that leaves me 3... downgrading my BIOS is not worth the risk just to make this work.  Looks like its time for a full migration plan so this issue becomes moot. 

  • K9A Platinum with PCI VIA 6421A SATA Controller

    Hi everyone, I have a problem, I was using a VT6421A VIA Sata Controller with K9A Platinum FW 1.1 without any problems, I upgraded to 4 GB of RAM with Vista x64 then flashed the motherboard 1.7 firmware, mother recognizes full 4 GB of Ram. After upgrade firmware to 1.7, PCI VIA Sata controller doesn't recognizes both Pioneer 112D attached to it, before firmware update it was working perfectly.
    I'm using RAID configuration in the motherboard, could be a problem betwen the motherboard's RAID and the VIA SATA Raid controller?
    Since the upgrade to 1.7 firmware, POST doesn't show the VIA Controller menu with the attached devices, Windows Vista can see the card installed but no drives attached to it  :(
    Any help will be much appreciated!
    Thanks in advance and sorry for my bad english.

    Quote from: GrounDZero6 on 24-October-07, 03:55:41
    Thanks for your reply, can you tell me how can I enable or disable memory remapping from the Setup?
    Where can I find it in K9A Platinum? is something that looks like HW/SW Memory Mapping or how it's called that option?
    Is it possible to get a screenshot of where i can change it??
    Thanks a lot!
    "can you tell me how can I enable or disable memory remapping from the Setup?  is something that looks like HW/SW Memory Mapping or how it's called that option?"
    Yes name of option is correct, but think its not available in BIOS if im correct.
    Can you test with 2GB of memory only to see if the problem will be duplicated there too?

  • NI pci 6251 position control

    Hi
    Im new to this forum and new to Labview and NI pci 6251 as well ;(
    I'm using NI-PCI-6251 (DC Motor ) with Labview to control the position of a DC motor  we developed the program that reads the encoder and display the position of the DC motor shaft
    but the problem is that the counter 0 (cnt0) always increases whether the disc rotating clockwise or anticlockwise??!! and when the desired position is reached the controller does nothing to stop the motor ?
    i don't know what is the problem or why its happening.

    Hi,
    I am also doing something similar.
    The problem is the motor is the DC motor from Quanser. (DCMCT).
    I know the encoder channel of the motor is ctr0 and when I test from "Measurement and Automation Explorer" (Labview>>Tools) I can only read the PFI8 channel.
    The motor read 4096 pulses per revolution and no reading is available from PFI10. As per Quanser the motor should be about to do position control. I have seen lab tutorials for position control in internet.
     I tested both the vi is mentioned above. The "Example" vi reads the motor position in terms of pulses. But when I rotate the motor in the other direction the count increment not decrement.
    Also the quadratureencoderMseries vi did not read the angle position when I set the channel values.
    I have attached the parameters that I set.
    Can any one please check..
    Thanks.
    Attachments:
    encoder issue.JPG ‏357 KB

  • Closed loop control of DC motor drive using PCI 6251

    Hi
    i am using NI PCI 6251 for closed loop control of dc drive.(shunt motor,220v, 0.5HP, 2.5A rated, 1500RPM)
    the dc motor is fed from a bidirectional dc-dc converter. this converter works in boost mode(forword motoring) and buck mode(braking mode/battery charging)
    the converter is built using mitsubishi IGBT module. at low voltage side of the converter a battery bank of 48V is connected and high voltage side the motor is connected.
    An IR sensor is developed to measure the speed of the motor and a hall current sensor is used to sense the converter current.
    in the control part i have an inner current control loop(PWM controller) and a outer speed control loop.both controllers are PI controller. To measure the speed i have used counter of the DAQ assistant, then frequency. then this frequency is converted to RPM using labview.after giving the speed and current signals  to the controllers , then i started  tunning the PI gain, but at the starting the duty cycles was 100%, so the IGBT got damaged immediately. now how to tune the controllers during the closed loop operation.  the switching frequency of the converter is 20KHz.   
    can any body suggest me how to run the dc drive in closed loop ?
    thanking you.

    Hi Premenanda
    The freq data receiverd from the daq assistant has the units of Hz, or in terms of motor speed, rps (rotations per second). I can see that you are trying to convert that to rpm (rotation per minute). which can be done by dividing the rps speed by 60. Instead, you are multiplying it by 60 and also comparing with 2000. the resultant multiplied value is displayed in your program only if it is smaller than 2000.which is causing the problem here.( as seen in file 'original code.png)
    I have attached a file named 'modified code.png' that shows how the conversion from rps to rpm is done. Please do the required changes in your code and let me know if it works.
    Attachments:
    modified code.png ‏18 KB
    Original code.png ‏15 KB

  • CONTROLLER PXI-PCI

    MY NAME IS ASHOK.
    I WORK AT AGILENT.
    MY EMAIL IS [email protected]
    DOES THE CONTROLLER CHASSIS PXI AND PC MUST BE SAME MODEL?
    FOR EXAMPLE, CAN I USE PXI-8330 (CHASSIS) AND PCI-8331 (PC) TO CONTROLLER?
    I HAVE HARDWARE ADAPTOR E/M/S, SHC-68-68 EPM AND SOFTWARE EXECUTIVE THAT I BOUGHT TO CALIBRATE DAQ PCI-6251.
    NOW, I NEED TO CALIBRATE TOO PXI-4060, PXI-4070, PXI-6711 AND PXI-6070E.
    WHAT NEW HARDWARE AND ACCESORIES ARE NEEDED TO CALIBRATE THEM?
    I VERIFIED PICTURES ABOUT PCI-6251 WITH PXI-6711=PXI-6070E ARE DIFFERENT.
    DOES CONTROLLER CABLE BETWEEN CHASSIS PXI AND PC FOLLOW TOGETHER WITH CONTROLLER MODULE?
    I WAIT FOR HELP.
    ASHOK. 

    Duplicated post.
    http://forums.ni.com/t5/PXI/CAN-I-USE-PXI-8330-WIT​H-PCI-8331/m-p/1429814
    Abel Souza
    Engenheiro de Aplicações
    National Instruments Brasil

  • I need to design fuzzy controller with pid control .

    hi ,
    I need to design fuzzy controller with pid control . to control   Dc servo motor i have NI DAQ PCI 6251 anyone help me??

    ssaara,
    Along with the shipping examples, here is a link to the PID Control Toolkit User Manual. Fuzzy Logic control is discussed in Part II of the manual, Chapters 5 and 8 are good starting points.
    --Michelle
    Instrument Control R&D
    National Instruments
    Instrument Control
    Machine Vision

  • How to trigger 5v -ve polarity from pci 6251 to sincronise the image capture

    Hello!
    I want to synchronise the image capture of an IEE 1394 firewire camera with an 50hz input signal (acquired from Vsync of VGA port ). I want to accomplish this using PCI 6251 (SCB 68 E series) device. The IEE 1394 camera can be triggered using a 5V –ve polarity signal but have no idea how it is achieved, some examples about the application would be helpful
    shri

    This example illustrates how an application might be constructed in order to trigger an analog acquisition as well as an external system concurrently with an E-Series board. The analog component has been made retriggerable by tying a counter pulse train to its sample clock. Due to the complexities of the DAQ STC, an analog output line is employed in order to generate a hardware-timed, regular, pulse used to trigger both the analog acquisition, and potentially an external system. This type of architecture could be used for "stimulous - response" testing.
    Attachments:
    Timing_with_AO.vi ‏123 KB

  • N500 with PCI device driver problem sound

    hi , i re instal a new windows in my N500, XP SP2, and i downloaded all the driver in lenovo site, extrat all the pacckage, but after all, i still have a problem with the sound, with only driver missing!! this mysterious PCI DEVICE....i try to found in all site about a solution, i updated my HDMI from microsft like they say and try so many other idea without solution....always when i install the file setup in DRIVERS\WIN\AUDIO\52av02ww\XP32    i found a strange message after a while showing "le pilote n'a pas été installé: le peripherqiue correspondant est introuvable" it means that the correspndant device is not found....
    this a copy of the report from everest
    Debug - Unknown
    Motherboard   DMIMOBO: LENOVO KIWDX  
    Motherboard   DMISYS: LENOVO 42335LG  
    Motherboard   SROSA001.86C.0000.D.0810200818    
    Motherboard   Unknown  
    PCI/AGP   14E4-1713: Broadcom NetLink (TM) Fast Ethernet [NoDB]    
    PCI/AGP   197B-2381: JMB38X SD Host Controller [NoDB]    
    PCI/AGP   197B-2382: JMB38X SD/MMC Host Controller [NoDB]    
    PCI/AGP   197B-2383: JMB38X MS Host Controller [NoDB]    
    PCI/AGP   8086-2919: Intel(R) ICH9M LPC Interface Controller - 2919 [NoDB]    
    PCI/AGP   8086-2928: Intel(R) ICH9M/M-E 2 port Serial ATA Storage Controller 1 - 2928 [NoDB]     PCI/AGP   8086-292D: Intel(R) ICH9M/M-E 2 port Serial ATA Storage Controller 2 - 292D [NoDB]     PCI/AGP   8086-2930: Intel(R) ICH9 Family SMBus Controller - 2930 [NoDB]    
    PCI/AGP   8086-2934: Intel(R) ICH9 Family USB Universal Host Controller - 2934 [NoDB]    
    PCI/AGP   8086-2935: Intel(R) ICH9 Family USB Universal Host Controller - 2935 [NoDB]    
    PCI/AGP   8086-2936: Intel(R) ICH9 Family USB Universal Host Controller - 2936 [NoDB]    
    PCI/AGP   8086-2937: Intel(R) ICH9 Family USB Universal Host Controller - 2937 [NoDB]    
    PCI/AGP   8086-2938: Intel(R) ICH9 Family USB Universal Host Controller - 2938 [NoDB]    
    PCI/AGP   8086-2939: Intel(R) ICH9 Family USB Universal Host Controller - 2939 [NoDB]    
    PCI/AGP   8086-293A: Intel(R) ICH9 Family USB2 Enhanced Host Controller - 293A [NoDB]    
    PCI/AGP   8086-293C: Intel(R) ICH9 Family USB2 Enhanced Host Controller - 293C [NoDB]    
    PCI/AGP   8086-293E: PCI Device [NoDB]    
    PCI/AGP   8086-2940: Intel(R) ICH9 Family PCI Express Root Port 1 - 2940 [NoDB]    
    PCI/AGP   8086-2942: Intel(R) ICH9 Family PCI Express Root Port 2 - 2942 [NoDB]    
    PCI/AGP   8086-2944: Intel(R) ICH9 Family PCI Express Root Port 3 - 2944 [NoDB]    
    PCI/AGP   8086-2946: Intel(R) ICH9 Family PCI Express Root Port 4 - 2946 [NoDB]    
    PCI/AGP   8086-294A: Intel(R) ICH9 Family PCI Express Root Port 6 - 294A [NoDB]    
    PCI/AGP   8086-2A40: Mobile Intel(R) 4 Series Chipset Processor to DRAM Controller - 2A40 [NoDB]     PCI/AGP   8086-2A42: Mobile Intel(R) 4 Series Express Chipset Family [NoDB]    
    PCI/AGP   8086-2A43: Mobile Intel(R) 4 Series Express Chipset Family [NoDB]    
    PCI/AGP   8086-4237: Intel(R) Wireless WiFi Link 5100 [NoDB]
    please who's have idea about this? who can help me?

    try to run executable files on right click by selecting "run as admin"
    and try to run this first, then try this.
    or try to run lenovo smart downloading.

  • Network controller and pci device driver missing for Toshiba Sattelite c55t b5109

    After resetting windows 8.1, I only my ethernet works and I cant turn my wifi. I looked in the device manger, and under "unknown devices" are listed Network Controller and PCI Device with yellow alerts near them. I know that these are related to the wireless card, but everytime I try to update them they say that there is no driver for them.
    These are their hardware id's:
    Network Controller:
    PCI\VEN_168C&DEV_0036&SUBSYS_083211AD&REV_01
    PCI\VEN_168C&DEV_0036&SUBSYS_083211AD
    PCI\VEN_168C&DEV_0036&CC_028000
    PCI\VEN_168C&DEV_0036&CC_0280
    PCI Device:
    PCI\VEN_10EC&DEV_5229&SUBSYS_F91B1179&REV_01
    PCI\VEN_10EC&DEV_5229&SUBSYS_F91B1179
    PCI\VEN_10EC&DEV_5229&CC_FF0000
    PCI\VEN_10EC&DEV_5229&CC_FF00
    PLEASE HELP!!!!

    search your laptop for the Toshiba application installer, open it and use it to install your Wireles lan driver.
    The application installer is easier than guessing which one you need from your support page.
    OR
    Your support page is here - http://support.toshiba.com/support/modelHome?freeText=1200008391
    You can select the drivers tab then down the page on the left hand side select Windows 8.1 64 bit to narrow down the drivers for your operating system. Then also select Wifi and the available drivers will be displayed.
    If you are getting a corrupted system after a reset your hard drive may be failing or your recovery partition may have been corrupted .  Create your recovery media if you have not done so already.
    S70-ABT2N22 Windows 7 Pro & 8.1Pro, C55-A5180 Windows 8.1****Click on White “Kudos” STAR to say thanks!****

Maybe you are looking for

  • Lost all Outlook e-mail after crash and reset to factory. How to restore e-mail?

    Firefox crashed and offered to reset my computer keeping my current tabs. I didn't think it would erase all of my Outlook inbox e-mail and all the e-mail stored in my folders. I tried Outlook recovery, but could not get it back. Is all lost forever?

  • Mac can't read a Windows CD...

    I downloaded a couple of Mac OS X updates on my Vista PC, burned them onto a CD (type CD-R) and took them to the Mac. After spinning up the CD, the following msg appears: "You have inserted a disk containing no volumes that Mac OS X can read. .......

  • Multithread read write problem.

    This is a producer consumer problem in a multi-threaded environment. Assume that i have multiple consumer (Multiple read threads) and a single producer(write thread). I have a common data structure (say an int variable), being read and written into.

  • Error on opening Eclipse Indigo design studio

    Hi, I am receiving the below error when tried to open the Eclipse Indigo Design Studio for OSM 7.2. !ENTRY org.eclipse.osgi 4 0 2012-07-31 14:20:23.421 !MESSAGE Application error !STACK 1 java.lang.RuntimeException: Application "org.eclipse.ui.ide.wo

  • How do you get a program to read an input file?

    I have a problem where i need my program to read an input file and the name of the input file should be read as a command line argument. How in the world do I do this?? I do not have the slightest idea how to get that done? Please help!!