alpanth Posted June 1, 2023 Share Posted June 1, 2023 Hello, first time working with the WaveformSDK and when looking at the DwfState's I saw something weird. DwfStateTriggered and DwfStateRunning is set to same value 3. Is there a reason for that? It seems like the number 6 is missing. If it is a typo I would like to know which state should be 6. From dwf.h with /************************************************************************/ /* Revision History: */ /* */ /* 06/6/2009(KovacsLA) : Created */ /* */ /************************************************************************/ Starting at line 104: // instrument states: typedef unsigned char DwfState; const DwfState DwfStateReady = 0; const DwfState DwfStateConfig = 4; const DwfState DwfStatePrefill = 5; const DwfState DwfStateArmed = 1; const DwfState DwfStateWait = 7; const DwfState DwfStateTriggered = 3; const DwfState DwfStateRunning = 3; const DwfState DwfStateDone = 2; Link to comment Share on other sites More sharing options...
0 JColvin Posted June 1, 2023 Share Posted June 1, 2023 Hi @alpanth, Attila (who created this material) is out of the office until next week to give an official answer, but I believe this is intentional based on the WaveForms SDK Reference Manual (available in the WaveForms installation folder on your computer); the start of section 5, Analog In (Oscilloscope) describes the Analog In instrument states and Running and Trig'd be described in the same state, which makes sense because once a trigger condition is met the acquisition would then be running. Let me know if you have any questions about this. Thanks, JColvin alpanth 1 Link to comment Share on other sites More sharing options...
0 Guest Posted June 1, 2023 Share Posted June 1, 2023 Hi @alpanth I raised this very issue with Atilla at some point in the distant past, because I ran into the same thing when making pydwf, and indeed this is intentional -- they are essentially two labels for the same number. Some instruments use the "triggered" terminology while others use the "running" terminology. I personally think it would be best of one of those labels were eliminated, because it just causes confusion. What adds to the confusion, of course, is that the value 6 is unused. Cheers, Sidney Link to comment Share on other sites More sharing options...
0 zygot Posted June 1, 2023 Share Posted June 1, 2023 Is it possible that DwfState enumerated as 6 is not unused, but perhaps undocumented or reserved? alpanth 1 Link to comment Share on other sites More sharing options...
0 alpanth Posted June 2, 2023 Author Share Posted June 2, 2023 Thanks everyone for the fast responses and clarification! Yeah it makes sense now. I guess I was too focused on the code, maybe a small comment would be indeed helpfull. Thanks again :) Link to comment Share on other sites More sharing options...
0 attila Posted June 5, 2023 Share Posted June 5, 2023 Hi @alpanth The origin of this state numbering was the use of the Gray code. Link to comment Share on other sites More sharing options...
Question
alpanth
Hello, first time working with the WaveformSDK and when looking at the DwfState's I saw something weird.
DwfStateTriggered and DwfStateRunning is set to same value 3.
Is there a reason for that? It seems like the number 6 is missing. If it is a typo I would like to know which state should be 6.
From dwf.h with
/************************************************************************/ /* Revision History: */ /* */ /* 06/6/2009(KovacsLA) : Created */ /* */ /************************************************************************/
Starting at line 104:
// instrument states: typedef unsigned char DwfState; const DwfState DwfStateReady = 0; const DwfState DwfStateConfig = 4; const DwfState DwfStatePrefill = 5; const DwfState DwfStateArmed = 1; const DwfState DwfStateWait = 7; const DwfState DwfStateTriggered = 3; const DwfState DwfStateRunning = 3; const DwfState DwfStateDone = 2;
Link to comment
Share on other sites
5 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now