Ladies and gents,
I have been working on a LabVIEW interface for a potentiostat I designed and built. I am not very experienced with LabVIEW, but do have programming experience with a variety of other languages (I had originally intended to use a FPGA for this, but was requested to write a LabVIEW VI first).
The goal:
I wish to output a voltage signal (initially composed of ramps) and measure the voltage of an operational amplifier configured as a feedback ammeter (using the feedback resistor value and voltage to calculate current) connected to an electrochemical cell. The feedback resistor is selected using an autoranging function (although I wrote a previous version with manual control) that ouputs TTL values through DAQ Assistants to select the relevant MUX channel. I then try to save the data in a spreadsheet.
The problem:
I am using a USB-6009 DAQ and I am aware this does not have a hardware clock. From reading around it seemed apparent the best way to output the voltage waveform was using the DAQmx package to define a write function within a software-timed loop. The problem I am having is that I cannot reliably synchronise the output with the input and I also have some errors relating to the DAQ resources being reserved (Error 50103). I think the way to resolve this would be to convert all the DAQ Assistants to DAQmx equivalents and try to bundle their execution- this is where I stumble. I tried to write a simple VI that shared a software-timed loop to read and write but had issues related to the AI min value (Error 200077).
General issues:
The way I start the write/read process (using a boolean switch) is very weak and does not feel robust. Ideally I would like some form of indicator to notify the user when the write/read process is running and when it has terminated.
My error handling is terrible but I cannot find much to read on the basics.
I only use one step sequence and I believe I should have more.
Once I hit start, the VI requests the file name for the spreadsheet- at first I was worried that the data would not be correctly captured, but I think this is okay as the file is generated then modified. It would be better if the user was prompted for the file name once the data collection was complete.
Any suggestions or assistance would be greatly appreciated. Thank you in advance.
Kindest regards,
Julius