08-27-2013 09:49 AM
Hello,
I have 2 devices: an Eurotherm temp-Controller and a keithley to apply voltage.
I have two separate VIs.
Now I want to apply them into 1 VI and then Measure Current against Temperature .
I tried using the State Machine concept for this, but I am still getting an error and I am stuck in between.
Please could someone take a look at the individual VIs for
Keithley,
Eurotherm
State Machined VI.
I am attaching the .llb files and the VI in this post and the next one. Please help.
08-27-2013 09:50 AM
continuation to above post
08-27-2013 11:35 AM
I'm not familiar with those particular devices and you didn't state what kind of error you are getting but reading through your code, this is what I see it doing:
Each of these steps is sequential. You have implemented a state machine but the state order is always Initialize->Eurotherm->Keithley->Stop so you have basically built a future proofed stacked sequence structure (future proofed in the sense that you can reorder the states, opitonally visit states, or revisit states, much easier due to using a state machine rather than a sequence structure).
Does this sound like what you intended for your program to do? In order to plot current vs temperature I would imagine you'd want multiple current and temperature readings. This would require you to operate both devices at the same time either in the same loop or in multiple parallel loops.
Hope this helps, good luck.
Simon
08-28-2013 06:30 AM
Hi Simon,
That is exactly my problem.
In the steps you have mentioned,
In step 4: the Setpoint Value and Stop temperature are to be taken same, from what I understand. Isn't it so? But the problem is if they are same, it is always sending FALSE to the smaller case structure and its continuously rotating in that very loop. So the data is not even reaching the last sequence where I can Read the process value, see alarms etc.
First doubt is:
Should not the stop temp be equal to the setpoint value?
Secondly,
In step no.8 of yours, I want to read each temperature and every current value at those temperature(say at a step of 10K ). How can I implement that? When you say putting multiple parallel loops, doesn't it mean using ,say, 2 while loops for 2 separate devices? in that case, does it any longer remain a state machine?
Please advice.
08-28-2013 12:03 PM
I think the state machine part may be confusing you a little. The states don't run in parallel so your values are never changing. You just sit in a loop computing the same result over and over.
You didn't post exact specifications and I don't have any hardware in front of me but I think a simple single loop will work for you. I've made a quick attempt at reorganizing your VI and adding some comments.
The loop will execute the specified number of steps and for each step:
Since we know how many steps we want to make and what our start and stop temperatures are we don't need to check to see when we should stop -- we know that we have a finite number of steps.
I also moved all the initialization code into two subVIs to make the diagram easier to read.
I hope this helps. Good luck on the rest of you application.
~Simon
09-25-2013 04:16 AM
Hello,
that solution was really helpful but still it is not SYNCHRONIZED: in the sense that, the for-loop is continuously setting the 'next step set point' and lets say
start temp = 390K
Stop T = 450 K
Step = 10K
So the for-loop is automatically going to next temp.but in reality NOT WAITING for the ET3504 to get heated and reach the next temp.
So when loop has moved to 400k Temp. the ET3504 is still heating up from 390K.
How to synchronize that?
So my device is at 296K(lets assume) but I want to measure from 390 to 450K. So first I should wait to reach start temp=390K and then read current at every 10K step . So everytime LV Code should check with device ET3504 the current temperature before reading current or going to next temp.in the for-loop.
09-25-2013 09:42 AM
If you put a while loop around where you read the temperature and current and only exit that loop once you are up to temperature then I think you'll get the behavior you want. The inner while loop (the one you need to add) will keep you at the same set point until it is reached before exiting and allowing the outer for loop to iterate to the next setpoint.
Inside the new while loop you could also add a case structure to determine if you want to take and save a current reading or not depending on what temperature the ET3504 is currently at.
10-09-2013 04:04 AM - edited 10-09-2013 04:07 AM
Hello Simon,
Your tips were very useful. thank you.
plzz could you take a look at the screenshot pic of my final block diagram.
Problem 1:
In the last flat sequence , where I have the text block to save my current and temperature on a text file, my datas in real are getting saved like:
temp
current
temp
current
temp
current
But I would like the text file to look like
temp current
temp current
temp current
Problem 2:
The XY Graph - Current over temp , also placed in the last flat sequence, is only plotting instantaneous current value for its corresponding temp. I would like to plot a continuous graph, where the last data point is also shown on the graph when the next point is plotted.
What should I do about it. Please help!
I am also attaching the VI for your reference.