[E3 Pins] AssignTo Questions
Hi,
I am a rookie in electrical field, and I have a question:
I would like to assign the device view's pins to U, V, W, E, and now I am stuck in the forth pin...Now matter how many times I tried, I cannot assign the fourth to 'E' ...
I can successfully assign the U, V, W, but it's very strange that the same method do not work out for "E"... It doesn't make sense...
The result is '-3'. In 'E3 Help', '-3' means 'No assignment possible - at least one pin of an invalid device.', which I totally don't understand...
I did see the 'E3 Help', but it didn't cover what I want(or I did not get it)... I use two For Loops. Below is what I have for code.
I've tried this for a whole day... Any reply would be highly appreciated. Thanks!
-
your code is difficult for me to comprehend. the if-statements has a complex math on right-hand side. this is difficult to debug. why not convert it into a variable to see the calculation?
i haven't scripted with terminals nor do i have much experience with designs using them. are you trying to name the pins on the terminal pin as U,V,W,E? or name each terminals?
in your image of the device tree, you have TB4#1 which is a view. do you know if the objE3Dev is set to a device (no view) or device-view? my suspicion is that you might not be able to assign a pin when its device-view. you might need to get the original ID.
on line 17311, do you know for certain that intTerID is valid? I would add the following to debug what is going on. when it shows an error message in the output window, click on the line and see what where it jumps in the device tree.
Dim dbg as Integer = objE3Pin.AssignTo(objDevPinIds(intTerID)
If dbg <> 1 Then
app.PutError(0, "intTerID: " & intTerID, intTerID)
End If -
Hi Bob,
Thank you for the reply, and sorry for my code being hard to understand. I've added more comments to it. BTW, It's my first time to code the pin things, too. :D
To answer your question, yes I am trying to name the pins on the terminal pin as U,V,W,E.; the objE3Dev is set to a green device(no view). BTW, I did't understand your suspicion(might not be able to assign a pin when its device-view...get the original ID???) Could you please explain more? Thank you very much.
Here is the picture with new comments. Hope it is easier to understand. Because under the yellow circle, all the pin would be the same name, to code easier, I get the fourth ID of all pins(objDevPinIds)
The first For Loop would run the green device, so when it get to the second run, it would run to E(the second green square)
Maybe my logy is wrong, or the same method to assign the UVW of the first device working out but the second green device failing is very strange...
-
Hi Paul,
Thank you for the reply! The "device tree" picture in my last post is what I am stuck with and is what I've done. It is in the half road...
Originally there are four green square devices. The question is I only need four yellow circle symbols(U,V,W,E), that is to say, I only need two green square devices. But because of the device view, I cannot combine the yellow circles into only two devices. What I did first is to delete the device view, then combine the yellow circle symbols, and then finally put back the device view. The final phase is what I am stuck with right now: to assign the pins back to the device view that I just put back.
Here is the original picture:
The picture below is after deleting the device view, combining the yellow circle symbols, and putting back the vacant device view↓
Then getting back to the picture of my first post. I have successfully assigned the first three yellow pins, but left the fourth pin unassigned...
Sorry Paul, I did not tell the whole story in my first post. I think the four pins of the device view could be assigned but we haven't find a way to assign. What do you think?
Please sign in to leave a comment.
Comments
4 comments