Not sure really how to explain what I'm looking for help on. But here goes:
I have a small set of commands that I want to let my user select and then I will create a function to implement it. For instance, in our software, we have three main loops. One for the Channel being tested, One for Temperature and one for Pressure. We also have a few commands that we would like to expose.
Here is my proposed list of Keywords:
CHANNEL_LOOP
TEMP_LOOP
PRESSURE_LOOP
NEXT_CHANNEL
NEXT_TEMP
NEXT_PRESSURE
SET_TEMP
SET_PRESSURE
DELAY
COMPARE
So now I will create a small User-Defined function using these keywords:
CHANNEL_LOOP
TEMP_LOOP
SET_TEMP
PRESSURE_LOOP
SET_PRESSURE
DELAY
MEASURE
COMPARE
NEXT_PRESSURE
NEXT_TEMP
NEXT_CHANNEL
After reading this list, somehow I need to convert it to VB.Net code that looks something like this:
For iChannel = 1 to Number OfChannels
For Each Temperature In TemperatureList
SetTemperature(Temperature)
For Each Pressure In PressureList
SetPressure(Pressure)
PressureDelay
Value = ReadValueFromChannel
CompareToTolerances(Value)
Next Pressure
Next Temperature
Next iChannel
I would love to convert this on the fly as the User-Defined function is read in, if possible.
Any ideas?
Thanks,
Tim
I have a small set of commands that I want to let my user select and then I will create a function to implement it. For instance, in our software, we have three main loops. One for the Channel being tested, One for Temperature and one for Pressure. We also have a few commands that we would like to expose.
Here is my proposed list of Keywords:
CHANNEL_LOOP
TEMP_LOOP
PRESSURE_LOOP
NEXT_CHANNEL
NEXT_TEMP
NEXT_PRESSURE
SET_TEMP
SET_PRESSURE
DELAY
COMPARE
So now I will create a small User-Defined function using these keywords:
CHANNEL_LOOP
TEMP_LOOP
SET_TEMP
PRESSURE_LOOP
SET_PRESSURE
DELAY
MEASURE
COMPARE
NEXT_PRESSURE
NEXT_TEMP
NEXT_CHANNEL
After reading this list, somehow I need to convert it to VB.Net code that looks something like this:
For iChannel = 1 to Number OfChannels
For Each Temperature In TemperatureList
SetTemperature(Temperature)
For Each Pressure In PressureList
SetPressure(Pressure)
PressureDelay
Value = ReadValueFromChannel
CompareToTolerances(Value)
Next Pressure
Next Temperature
Next iChannel
I would love to convert this on the fly as the User-Defined function is read in, if possible.
Any ideas?
Thanks,
Tim