Hello everyone,
I'm a begginer with Labview and recently had to write a Labview programme to monitor and control the power supply of a superconducting magnet. The power supply is connected to the PC by a USB to Serial cable. I studied carefully most of the VISA examples and started programming. The structure of the programme is composed by an initialisation stage followed by the output reading and issuing commands to ramp the field, etc. Ideally, the output reading should be independent from the rest and should be reading at all times.
The problem is there is only one common communication channel so whenever I do a VISA Read, doesn't matter where it's issued, it always reads the last request made, i.e. let's suppose I request the magnet output. doing a VISA Write to send the command. If between the VISA Write and VISA Read - to read the magnet output string - there was another VISA Write in another branch of the programme, requesting another thing, the string returned is stacked on top of the last one so the programme reads the wrong string, corresponding to another request.
I tried to write the programme in only one branch and it went fine because it was processing in sequence, always waiting for the last request and doing one thing at the time until I needed to have this big subvi in the middle that waited while the magnet was ramping from one point to another. During this stage there was no output reading, of course.
Is there a way to have multichannel communication is this case? Is there a way to protect (encapsulate?) the Write->Read sequences in order to read only the corresponding string?
Sorry for my english and thanks in advance,
Pedro