Most WPF controls you will use are derived from FrameworkElement and use the Language property to format values according to the corresponding culture. By setting the default value for this property you get consistent formatting for all controls in your application.
Just a quick reminder to my self in case I make this mistake in the future. The configuration of the built-in ethernet port open settings in GX Developer IEC requires port numbers to be expressed in hex.
This can be confusing if the configured port number only use digits between 0 and 9 like my current configuration. I managed to get confused by this even though the dialog explicitly states that you need to use hexadecimal numbers for the port configuration.
If you take a quick look at it and try to send a request to port 1392 you will not succeed:
client.Open("192.168.0.1", 1392);
client.ReadWords("D0", 1);
The correct code also needs to use the hexadecimal number:
client.Open("192.168.0.1", 0x1392);
Or use the correct decimal number:
client.Open("192.168.0.1", 5010);
WhenAnyValue
is a method on ReactiveObject
that can turn INotifyPropertyChanged.PropertyChanged
events into an IObservable
.
var layerNotes = this
.WhenAnyValue(vm => vm.LayerViewModel)
.Select(vm => vm.Notes)
.ToProperty(this, vm => vm.Notes);
The code above will actually only push property changes through when the LayerViewModel
property is changed. Not when its Notes
property changes.
The correct way is to use the complete property chain in the call to WhenAnyValue
like the following code:
var layerNotes = this
.WhenAnyValue(vm => vm.LayerViewModel.Notes)
.ToProperty(this, vm => vm.Notes);
The code above will push property changes containing the content of the LayerViewModel.Notes
every time the LayerViewModel
property changes or its Notes
property changes.
If you get the error code 0x4031 when using MC Protocol to communicate with a QCPU it means that you are trying to read or write to a device address that is out of range. You might as, I did, forgot to setup the file registers in GX IEC Developer.
The TabablzControl
in Dragablz is capable of displaying content before and after the tab headers in a simple way.
Use the HeaderPrefixContent
and HeaderSuffixContent
properties on TabablzControl
. Use HeaderPrefixContentTemplate
and HeaderSuffixContentTemplate
respectively to provide a template to your content in case it is something else than XAML.
<dragablz:TabablzControl HeaderSuffixContent="After">
<TextBlock Text="Tab 1"/>
<TextBlock Text="Tab 2"/>
<dragablz:TabablzControl.HeaderPrefixContent>
<TextBlock>Before</TextBlock>
</dragablz:TabablzControl.HeaderPrefixContent>
<dragablz:TabablzControl.HeaderSuffixContentTemplate>
<DataTemplate>
<TextBlock Text="{Binding}" ToolTip="You can easily insert content here using HeaderSuffixContent"/>
</DataTemplate>
</dragablz:TabablzControl.HeaderSuffixContentTemplate>
</dragablz:TabablzControl>
Just a quick reminder that you need to reboot your Mitsubishi QCPU PLC after you have edited and downloaded the ethernet port open settings.
Google Sheets can display hyperlinks in cells but sometimes you do not want to see the whole hyperlink in the cell. Why not display a nice icon instead? Let me explain how to do it.
The following formula insert a icon that is hyperlinked to an issue on GitLab. The cell A17
should contain the issue number on GitLab. If A17
is blank the icon will not be displayed.
=IF(ISBLANK(A17);;HYPERLINK(CONCAT("https://gitlab.com/gitlab-org/omnibus-gitlab/issues/";A17);IMAGE("https://cdnjs.cloudflare.com/ajax/libs/foundicons/3.0.0/svgs/fi-link.svg")))
I use the link icon from the foundicons library hosted on cdnjs.
I am writing a client API in C# for the MELSEC Communication Protocol and wanted to perform a communication test to a PLC. The PLC system I had available was a two CPU system and I used GX IEC Developer to create a simple test program. Since it was a simple communication test to see if the client API was reading and writing devices correctly I was not interested in the second CPU at all.
However, I could not get the PLC program running because of a CPU LAY ERROR
. This can be fixed by configuring the correct number of CPU in the system. I then received a MULTI CPU DOWN
error which seemed to occur because the default setting is to share memory between multiple CPU. When this setting was removed I got the program running and could proceed with the communication test.
Hopefully this post will be of use to me or somebody else in the future.
After installing GX Works 2 1.501X on my Windows 8 development laptop I found out that I was not able to communicate with the PLC through the USB cable as usual. After some troubleshooting I found out that the Mitsubishi Easysocket USB drivers has not been installed properly:
This issue can easily be fixed by updating the drivers. Just follow these steps:
Device Manager should be able to find the driver and update it successfully. When the installation is done the driver should appear with the name "MITSUBISHI Easysocket Driver" like this in Device Manager:
I was looking for a way to cancel a ReactiveCommand<T>
in ReactiveUI but could not find any good official documentation on this. Instead I came up on Gluck's solution on StackOverflow (surprise!).