Skip to content
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

Traceback on fixed point object #3

Open
Suicidal-Insanity opened this issue Sep 25, 2020 · 3 comments
Open

Traceback on fixed point object #3

Suicidal-Insanity opened this issue Sep 25, 2020 · 3 comments

Comments

@Suicidal-Insanity
Copy link

Suicidal-Insanity commented Sep 25, 2020

When running this on a realtime system VI, I get the following traceback:

Error: 'TDObjectFixedPoint' object has no attribute 'rangeFormat'
Traceback (most recent call last):
  File "readRSRC.py", line 224, in <module>
    main()
  File "readRSRC.py", line 160, in main
    vi = VI(po, rsrc_fh=rsrc_fh, text_encoding=po.textcp)
  File "pylabview-master\LVrsrcontainer.py", line 233, in __init__
    self.readRSRC(rsrc_fh)
  File "pylabview-master\LVrsrcontainer.py", line 388, in readRSRC
    self.checkSanity()
  File "pylabview-master\LVrsrcontainer.py", line 803, in checkSanity
    if not block.checkSanity():
  File "pylabview-master\LVblock.py", line 6159, in checkSanity
    ret = self.checkTypeDescListSanity(section, section_num)
  File "pylabview-master\LVblock.py", line 5845, in checkTypeDescListSanity
    if not clientTD.nested.checkSanity():
  File "pylabview-master\LVdatatype.py", line 2464, in checkSanity
    ret = super().checkSanity()
  File "pylabview-master\LVdatatype.py", line 838, in checkSanity
    if not super().checkSanity():
  File "pylabview-master\LVdatatype.py", line 672, in checkSanity
    exp_whole_len = self.expectedRSRCSize()
  File "pylabview-master\LVdatatype.py", line 2351, in expectedRSRCSize
    ref_obj_len = self.ref_obj.expectedRSRCSize()
  File "pylabview-master\LVdatatyperef.py", line 310, in expectedRSRCSize
    exp_whole_len += obj.expectedRSRCSize()
  File "pylabview-master\LVclasses.py", line 479, in expectedRSRCSize
    exp_whole_len += clientTD.nested.expectedRSRCSize()
  File "pylabview-master\LVdatatype.py", line 2706, in expectedRSRCSize
    if self.rangeFormat == 0:
AttributeError: 'TDObjectFixedPoint' object has no attribute 'rangeFormat'

I checked and the parseRSRCData function was not called for the object instance that throws the error.

Previously I received multiple warnings which may be relevant:

example.vi: Warning: Block b'LIbd' section 0 parse exception: LinkObj b'HpEr' parsing not implemented.
example.vi: Warning: Block b'LIbd' section 0 size is 55422 and does not match parsed size 21419
example.vi: Warning: Block b'LIds' section 0 parse exception: LinkObj b'DSVl' parsing not implemented.
example.vi: Warning: Block b'LIds' section 0 size is 24085 and does not match parsed size 1968
example.vi: Warning: Block b'LIvi' section 0 parse exception: LinkObj b'VIVl' parsing not implemented.
example.vi: Warning: Block b'LIvi' section 0 size is 29914 and does not match parsed size 3387
example.vi: Warning: Heap Container tag='OF__StdNumMin' parse exception: Tag 'OF__StdNumMin' of Class 'SL__stdNum' could not parse its TypeDesc type=95 dependent content.
example.vi: Warning: Heap Container tag='OF__StdNumMax' parse exception: Tag 'OF__StdNumMax' of Class 'SL__stdNum' could not parse its TypeDesc type=95 dependent content.
example.vi: Warning: Heap Container tag='OF__StdNumInc' parse exception: Tag 'OF__StdNumInc' of Class 'SL__stdNum' could not parse its TypeDesc type=95 dependent content.
example.vi: Warning: Heap Container tag='OF__StdNumMin' parse exception: Tag 'OF__StdNumMin' of Class 'SL__stdNum' could not parse its TypeDesc type=95 dependent content.
example.vi: Warning: Heap Container tag='OF__StdNumMax' parse exception: Tag 'OF__StdNumMax' of Class 'SL__stdNum' could not parse its TypeDesc type=95 dependent content.
example.vi: Warning: Heap Container tag='OF__StdNumInc' parse exception: Tag 'OF__StdNumInc' of Class 'SL__stdNum' could not parse its TypeDesc type=95 dependent content.
example.vi: Warning: Block b'FPTD' section 0 size is 4 and does not match parsed size 2
example.vi: Warning: Block b'CPC2' section 0 size is 4 and does not match parsed size 2
example.vi: Warning: Block b'CCST' section 0 size is 186 and does not match parsed size 4

Also, slightly off topic, but diffing the XML file with one generated from a slightly modified VI shows a massive amount of changes. Is the order of the XML output variable, or does labview regenerate all the IDs everytime?

@mefistotelis
Copy link
Owner

mefistotelis commented Sep 25, 2020

File "pylabview-master\LVdatatype.py", line 2706, in expectedRSRCSize if self.rangeFormat == 0:

Hm, that is line 2698 in current HEAD. Any interesting code you've added?

Anyway, defining all the properties in constructor (__init__) should help.

Is the order of the XML output variable, or does labview regenerate all the IDs everytime?

Yep, LabVIEW reorders things on each save. pylabview just exports everything in the order things are stored within VI.
You can test that by extracting and then re-creating the VI. It should be identical.

@Suicidal-Insanity
Copy link
Author

I only added some code to verify that the parse function wasnt being called, nothing interesting. And some hasattr checks, since I wasn't sure what defaults to use.

XML: Ok, so if I do end up using this as a way of keeping track of changes to the VI in version history, I would need to reorder the XML every time to some sort of consistent state? Or does reordering also involve changing IDs and so on?

@mefistotelis
Copy link
Owner

I would need to reorder the XML every time to some sort of consistent state? Or does reordering also involve changing IDs and so on?

Yep. Most items from sections (ie. Data types) are referenced by ID.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants