-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tinyPDC: get_config() ; PdcError("Invalid Configuration message received") ; FPS, Data Rate monitoring in Real Time #24
Comments
it isn't that you can't read check the CFG2 after pdc.start(). when you use the method pdc.get_config() what you do is to ask the PMU the CFG then you wait patiently to the data arrive and when it arrives the program parses the information and updates the class attribute pmu_cfg2. The only type of package that it expects is a config frame it doesn't expect anything other than that, to the extent that it will raise an error if it is a dataframe. the method pdc.get() is extremely powerful, it can parse almost anything in the IEEEC37.118. the solution to your issue is simple, don't expect a CFG2 frame, just expect something. but you have to ask the PMU the CFG2. the following code will ask the CFG2 frame. and not expect ONLY a dataframe it will expect, in the manner of pdc.get(), anything, when it receives the CFG2 frame pdc.get method will parse and update, but then you won't have clearly the CFG2 frame, as you'd have with this probably wasn't my best explanation so if something wasn't understood please ask
|
Hi Yuri,
|
Hello Yuri, |
you need this line of code to ask the PMU to send the Data from the code you've shown (I don't know what else there is in the code you've only sent a snippet) you're not asking it.
this code would ask EVERY SINGLE TIME THE CFG2 so it wouldn't be practical because normally you wouldnt change it sooo frequently. so i'd suggest asking it at a fixed interval. I suggest trying this code and posting the results on the matter of frame/rate.
but i'd suggest tweaking it a bit to fit your needs. i don't know your parameters. you'll only have issues with timing if you ask too much the CFG2 (let's say one CFG2 every sample). |
pypmu/examples/tinyPDC.py
Line 19 in 66e6c49
Hi all,
I am trying to monitor the configured frame rate continuously since I will be changing it dynamically from the PMU end.
I was tinkering with the code of tinyPDC and noticed that if I use
config = pdc.get_config() # Get configuration from PMU
before I use
pdc.start() # Request to start sending measurements
I get Config2 and this is what I was sending from the PMU. But after the request to start sending measurements I cannot fetch the configuration anymore. I get the PdcError
PdcError("Invalid Configuration message received")
Somehow,
config = pdc.get_config()
is no longer a "ConfigFrame2". Why is that?Before it was <synchrophasor.frame.ConfigFrame2 object at 0x000001509F83B5C0>
After
pdc.start()
it becomes <synchrophasor.frame.DataFrame object at 0x00000276DBCDCC18>(I suppressed the error in the pdc.py to get it)
Why can't I check the configuration after the PDC starts?
The text was updated successfully, but these errors were encountered: