|
Hi Everyone,
Can sombody help me how I can written a monitor en datalog program for get the data from my Digital Multimeter via the serialport. It's okay if someone here written an console application or an short GUI application. I would like to use VB6 and VB.NET
Here in attachment show you the dataformat :
Communication settings
=================
Übertragungsrate : 9600 baud
Charakter code : 7-bit ASCII
Parität : keine
Stop-Bits : 2
Dataformat Settings
===============
<a href="http:
Example
=======
<a href="http:
Kind regards
Steven
|
|
|
|
|
There's nothing special here. It's a standard serial port trans/receive app. It doesn't matter what you're talking to or what parameters you're using.
"VB.NET Serial Port example"[^]
|
|
|
|
|
remove this message from the vb forum
modified 10-May-13 16:44pm.
|
|
|
|
|
There's already a class written to do this: Microsecond and Millisecond C# Timer[^]
Don't expect 1us accuracy as Windows is not a real-time operating system and there is overhead to account for when the code calls your callback method.
Here[^] is another article, but the guy arrogantly claims sub-1us accuracy using flawed measuring techniques. It's simply not possible to achieve on Windows on todays hardware.
|
|
|
|
|
Hi,
Thanks for your response but I can't programming in C# and it's mangaged code. I looking for unmanaged code that written without classes and uses winapi and c++ or c
Can somebody help me for writing the code for the microseconds functions TimeInit_us(), TimeRead_us() and Delay_us(). It's no problem if there inline assembly
Not code with C#.NET with classes
|
|
|
|
|
You're not going to get that in the VB forums...
VB6 has been dead for a long time and it's very unlikely you're even going to find a solution that's not wrapped in a class.
Here's a thought. Study the code in the articles to see how they work and rewrite to your specifications.
No matter how much you inline or convert to assembly, you STILL cannot get microsecond accuracy because Windows is a PRE-EMPTIVE multitasking O/S. That means your code can and will be stopped at any point in time and control of the core your code was running on moved to another thread, including during the code that's running when kicked off by your timer.
|
|
|
|
|
Hi.
I am starting to get into user controls and I have one I was using as an example. All it has on it is a TreeView, but when I place an instance of the user control on a form, I cannot access all of its usual properties, such as TreeView.Nodes...In other words, .Nodes does not even show up as a property. I am assuming that somewhere in the code for the control, something must be happening that prevents certain properties from being exposed.
UPDATE: I'm thinking it means that a usercontrol will not expose any properties of other controls placed on it, unless they are explicitly exposed via declaring properties for such.
Much obliged for any help!
modified 9-May-13 19:55pm.
|
|
|
|
|
OK...It looks like that is the case. According to MSDN, constituent controls' properties are Private and must be exposed manually by creating Public Properties with the Get and Set accessors.
|
|
|
|
|
HEHEH...Now I'm not so sure. When I tried accessing the properties of the CONSTITUENT control in the UserControl, I was able to get to the properties, like:
UserControl1.TreeView1.Nodes.Find
|
|
|
|
|
That is probably because your UserControl is defined in the same project as you are working in. The default access modifier is "Friend" so you can see it as long as you are working in the same assembly. If you move the UserControl to a library, you would not be able to access it unless you modified it's access modifier to "Public".
Take a look at your UserControl1.Designer.vb file.
|
|
|
|
|
Yes, it is definitely 'Friend" and in the same assembly, not a dll. But for the future then, if I compile a usercontrol class into a library, declare it as Public, then, right?
|
|
|
|
|
That depends on your requirements. Most of the time, you don't need to exposes the ENTIRE set of properties of the constituent control(s). You can supply properties to expose only the control properties you need or none at all and write your UserControl properties and methods to control the constituent controls internally.
|
|
|
|
|
I basically came to the same conclusion after I started thinking about it. Each constituent has a ton of properties you would never want to even see from a user control point-of-view.
|
|
|
|
|
If you want designer support, you would need to expose the control via a property and then write your own CodeDomSerializer to write to the form.designer.vb file.
|
|
|
|
|
Hold on though. I thought the whole idea of a usercontrol was to be able to access all of its properties just like any other control, even if that control has consituent controls inside it. I am curious as to why it is so difficult to get to those properties.
|
|
|
|
|
The point behind a UserControl is to create a custom control with a bunch of other controls as children, all working as parts to solve a common goal.
For example, a TextBox and a button next to it can be placed in a UserControl. The TextBox can be ReadOnly and the button is clicked, opening a OpenFileDialog that lets the user pick a path and you can then put the path into the TextBox and have that path returned as a property of the UserControl. The user does not get to type in the TextBox.
The only property the UserControl would expose would be the path selected, not any of the properties of the TextBox or Button.
|
|
|
|
|
In that regard, it dawned on me after I wrote that that if you had 4 constituent controls in a usercontrol, that is a hell of a lot of properties to have to expose, especially since many of those properties have the same names for different controls...A big mess when you really aren't concerned with those properties outside the user control.
|
|
|
|
|
Sorry, I did not think that one over enough before posting it.
You would not need a custom serializer if you exposed the child control's properties as properties of the UserControl. Basically it comes down to the fact that you need to write some code to expose properties of the children controls in the VS designer.
As for your comment, Dave's response says it very well. The only thing that I would add to that, is that the usercontrol template facilitates the visual design process.
Also, here is good article on the subject link.
|
|
|
|
|
Thanks for that info, and the great link.
So basically, declaring properties is the only way to get those properties to the user. Which is great from a control management point-of-view, but necessarily a lot of work, if for some hypothetical reason, you needed to expose all the constituent controls' properties. But, now that I've been thinking about this and reading all of your replies, it's hard to imagine why that scenario would even exist.
|
|
|
|
|
Quote: So basically, declaring properties is the only way to get those properties to the user.
Not exactly. And I don't know why I did think of this earlier.
Assume you place the UserControl in a class library.
As previously mentioned, you could change the child control's access modifier to Public and it would show up in the property grid and you could try to set it's properties. They would appear as set in the designer, however any of the changes are only held in Visual Studio's memory and not written to disk as part of the designer generated code. Building the project would clear any of these apparent property changes. To avoid confusion in the designer, I would set the access modifier to private and expose it through a property like this:
<System.ComponentModel.DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Content)> _
<System.ComponentModel.Browsable(True)> _
Public ReadOnly Property ExposedTreeView As TreeView
Get
Return TreeView1
End Get
End Property
This allows you to reference the child control in both code and via the property grid for the placed UserControl. The magic is in the DesignerSerializationVisibilityAttribute. It tells the designer to write the changes to the Form.designer.vb file.
|
|
|
|
|
I'll take a gander at that one. Sounds nice and elegant.
|
|
|
|
|
I have three Comboboxes
cmbA, cmbB, cmbD and datagridview1, Button1, button2
by button1 click, I want to add 1st rows to datagridview1
click again add 2nd rows
by button2 click i want to delete selected rows.
please help me to solve this by providing sample code snippet
|
|
|
|
|
Posting a specification and asking for code will not garner much of a response.
What have tried thus far? (show your code)
Explain what part is not working, and people will be willing to help you solve the problem.
|
|
|
|
|
Hi,
I have working with sockets i want to play youtube videos using sockets please help me
|
|
|
|
|