03-28-2013 12:53 PM
Hello,
Thanks for the reply.
My intention of how the program should work is that in every iteration of the while loop there comes in an array of CAD data with a range [-180,180] and I want to generate a time based digital pulse between the two user input values of CAD as you can see from the attached VI. Then I transform these CAD values to time values and I calculate the inital delay ( calculated from the first CAD value i.e rising edge for the pulse), I also calculate the high time ( the time value difference between the second and the first CAD input values) and likewise the low time for the pulse definition. Apart from that the pulse will have 5V value.
Am I on the right track so far?
04-02-2013 02:36 AM
Henok,
You still have not mentioned all of the parameters required for your pulse. a 5V pulse would mean an amplitude of 5, but you have not mentioned the pulse width. You can use one of the example programs to generate a pulse easily enough. You can use a case structure to choose the type of pulse (depending on its parameter) everytime you get a different CAD value. For example, when you get (-180, 180), set the case structure to choose and then send a 5V.
Unfortunately, I cannot open your file as my LabVIEW version won't support your file so I have no way of checking if you are on the right path. But, from this thread, it looks like you are indeed on the right path and might have enough information and advice to move forward?
04-02-2013 03:24 AM
Hi The_Sugarman,
I am not sure which parameters I am missing. As per the width of the pulse, it is going to be defined by the corresponding time values of the rising and falling edge CAD values selected by the user. So for example if there is a CAD difference of 30 degrees between the two values, the time instance taken to sweep 30 degrees will be the width of the pulse, which ofcourse is going to vary with the engine speed. So this parameters are going to be varying accordingly.
I have attached the vi in LV 10 version. I hope you can view it in that version, if not let me know which version of LV you are using.
Regards
04-02-2013 03:35 AM
Ahh OK, I understand now. So basically, your pulse width varies according to the difference in CAD values. Now, does the user have to get exactly the difference in CAD values as Puls Width or is it OK if it is a specific value that you set?
If this is the case, can I go back a step and ask you if you have managed to successfully read in the CAD values?
Again, I cannot open the file, my LabVIEW version is 8.5.1
04-02-2013 03:55 AM
Here I have attached a version in LV 8.0.
The user sets in CAD values which will then be converted to time value in the program to determine the pulse width. Perhaps you'd get more understanding of the system when you open and see the file.
Yes the CAD values are being read in an OK manner. One thing I should mention here is this is just a small portion of the program I am working on. The CAD vector is coming from a separate loop and that is why I show the CAD vector coming in to the loop and the detection of the user input values are done inside the while loop as is the pulse generation.
Let me know if I answered your question or just rumbled nonsense 🙂
I appreciate your follow up.
04-02-2013 05:05 AM
Henok, without actually runnning your whole program or atleast the part you have trouble with, I would not be able to fully understand at what stage you are in, what you need to work on and how you can work on these problems. By looking at your code, it looks like it looks ok, assuming that all your CAD related readings/measuremnts and the concerned Data Acquisition parts are working fine.
Now, what is the problem with you trying to generate a Pulse here?
Sorry for very generic and repeated questions, i am trying to fully understand your problems here.
04-04-2013 02:50 AM
Hello,
Sorry for the late reply...
The code works as needed generating the pulse defined by the high and low times and the initial delay. With some problem of when the high time ( which is defined by the time deference between the two user input CAD values) becomes zero, the DAQmx Create Channel vi generates an error saying the value should not be less than the counter time base ( I am using the 100KHz time base). I traced this error to be caused by the threshold 1D array vi. This is caused when the user inputs two, very close CAD values (for example with less than 0.1 CAD difference) so the threshold 1D array vi returns same indexes for the CAD values. ( I also think there might be inconsistency with the CAD array itself, sometimes the values are not evenly spaced and even not fine enough for 0.05 CAD resolution, which makes the above mentioned error)
Thus far I am able to detect CAD values and generate a pulse with width of 4 micro seconds. But with my 0.05 CAD resoulution requirement I am aiming for 0.4 microseconds pulse.
Any ideas on how to improve my code or....?
04-04-2013 07:45 AM
Hi Henok,
Unfortunately, I am not an expert on DAQ or the arrays. To me, the problem can be narrowed down to the 1D array and your signal generator. Both of these together does not seem to be compatible with regards to the size or frequency. That's my view on it. By 'playing around' with the 1D array and the signal genertor frequency/amplitude or pulse width, you could be able to correct the problem.
Sorry Henok.
04-05-2013 04:48 AM
Hello again,
I am actually thankful for the help so far.
What the final say I have on this problem is making sure the generated CAD array is as fine and distinct as it can be will assure the detection of each and every value in the array with the threshold 1D array vi. I will verify if the source of data (i.e CAD array is as it should be). With this I would like to bring this thread to an end.
Thanks for the help guys!
Moreover, there has been a development with the situation that, until now how I was trying to come around the need for generating a digital pulse up on the user input of two CAD values, where I would write a Pulse HIGH in the interval of the two CAD values. And the incoming CAD signal had been processed and synced with the TDC signal where its made to be chunked in to cycle based data. What I am trying to tell is the way I implement the digital pulse generation functionality now is prone to delay due to large sum of data processing before the point in the application where I implement my digital pulse generating code.
So I was thinking what if I could instead directly input both my TDC and CAD pulses in to the digital I/O box ( I happen to have SCB-68 connected to PXIe-6361 ) and use the flank counting ( I dont really know what I am talking about here, but let me know if I am not making sense). I am going to have 360 CAD pulses per revolution and 1 TDC pulse every revolution. If somehow I can sync these two in such a way that the CAD starts counting right after a positive flank on the TDC pulse and so on. And I would want to for example at an engine speed of 20K RPM I'd like to have a CAD resolution of 0.05, which I calculated that I would at least need 2.4MHz clock speed on my counter.
Is there an already made example of such a problem? I would really appreciate your help once more.
Regards!
04-05-2013 06:18 AM
Henok, happy to know we have been of help.
Can you explain this paragraph a bit simpler please? I don't understand the whole paragraph.
So I was thinking what if I could instead directly input both my TDC and CAD pulses in to the digital I/O box ( I happen to have SCB-68 connected to PXIe-6361 ) and use the flank counting ( I dont really know what I am talking about here, but let me know if I am not making sense). I am going to have 360 CAD pulses per revolution and 1 TDC pulse every revolution. If somehow I can sync these two in such a way that the CAD starts counting right after a positive flank on the TDC pulse and so on. And I would want to for example at an engine speed of 20K RPM I'd like to have a CAD resolution of 0.05, which I calculated that I would at least need 2.4MHz clock speed on my counter.