This is what I do! (Avionics manufacturing traceability)

A post from Cogiscan that is very near-and-dear to my heart crossed my feed recently. It discusses traceability information in the automotive industry’s electronics manufacturing environment. The avionics industry that I work in has similar requirements, albeit even more stringent.

Part of the post lists out six categories of traceability (in bold), and I’ll expand on how my organization has used each of those information:

1. Who touched the product. We’ve had operators who violated process and were terminated as a result. We needed to review all units that they worked on to determine whether rework was required.

2. When was it in process. We’ve seen defects increase during rapid environmental fluctuation. Identifying the units with work in progress at that time helped us focus closer inspection on the subset of units at risk.

3. What operations and equipment it went through. If we determine a particular piece of test equipment is malfunctioning, we can determine the assemblies which it processed and pull them back for re-test.

An additional aspect that’s closely related is being able to show whether the equipment is being properly maintained at the time it touched products, that the equipment was validated after installation, and is suitable for the requirements of the task. (i.e. That it can do what we’re using it for, within the tolerances we need.)

4. How that process transpired. Traceability data doesn’t have much impact upon this, but we have excellent proof of process. We strictly enforce that all of our production processes are documented in compliance with design docs and equipment usage. Our documents must be approved prior to use, all changes are tracked via coded revisions, and when we need physical documents their distribution is tightly controlled. Our operators are trained and re-trained when needed, on a process-specific frequency, and we retain ongoing records of their training.

Further, our assemblies are all individually tested upon product-specific test equipment and processes that are as stringently-controlled as our production processes – arguably, under even tighter control due to its governance by the Quality department.

5. What materials were used. Each assembly we build is tracked with a unique serial number. Raw materials and component parts are tracked via lot batch, which indicates their source. When materials are replaced, the old data is retained and can be queried. We’ve needed to identify all lot batches used for a component of a particular part during failure analysis. We’ve also needed to identify all units that include a particular lot batch of a component.

6. Where those materials came from. A raw material or component lot batch tracks back to our ERP ordering system. We can identify the unique receipt line of a shipment against a purchase order. It identifies the source organization, when it was received, where it was stocked, etc– generally, the same traceability information as tracked by our production systems.

Posted in Business, Musings, Operational Technology | Leave a comment

Feature Debugging flags

I chuckled today when I received an add from launchdarkly.com. They’re a “feature flag” SaaS provider. I explained the concept of feature flags to a non-software-developer just a few weeks ago, so maybe my phone was eavesdropping. I was amused by the bright-and-shiny presentation. Although it’s new to some people, this stuff ain’t new to me.

The concept of feature flags is an old friend. The old school EMS ERP system used a configuration-driven system to control application development. It allowed extension into customer-specific modifications. We also used this to control standard but customer-specific operating modes- for example, fiscal year vs calendar year or cash basis vs accrual basis.

I’ve used this more recently to add a level of granularity to debugging messages. Sprinkling Debug.Print messages during app dev and initial troubleshooting is fairly normal, and the compiler Debug/Release setting means you can leave them in your code forever without impacting released software. However, this requires extra work to remove them, and in the future you might want to restore them for diagnostics — and you already did the significant work of deciding which messages were valuable. So, how??

Add an enum that lists all features, another to list the features in active debugging, and a third to contain the other other features that are not being debugged. Enclose your Debug.Print statements with something like this:

        bool debugging = FraMES.IsFeatureDebuggingEnabled(Feature_Debugging_Flags.FraMESActivities);
        if (debugging) Debug.Print("frmMain.OpenActivityDialog is updating the font size to: {0}.", subdialog.Font.Size);
    /// <summary>
    /// Given the an application feature,
    /// return the status of it's debugging flag.
    /// </summary>
    /// <param name="enumName"></param>
    /// <returns></returns>
    public static bool IsFeatureDebuggingEnabled(Feature_Debugging_Flags feature)
    {
        // Extract the name of the feature into a string and search for the string name,
        // because the Enum doesn't translate directly to another Enum.
        string featureName = feature.ToString();
        bool result;
        if (Enum.IsDefined(typeof(Feature_Debugging_Flags_Enabled), featureName))
        {
            result = true;
        }
        else if (Enum.IsDefined(typeof(Feature_Debugging_Flags_NotEnabled), featureName))
        {
            result = false;
        }
        else
        {
            throw new NotSupportedException("MES Utilities has no application feature named: " + featureName
                + ". The MES Utils developer must add it to one of the enums FraMES.Feature_Debugging_Flags_Enabled or _NotEnabled."); 
        }
        return result;
    }
Posted in C#, Musings, Programming | Leave a comment

Open the application folder, Hal.

Some applications *cough ClickOnce cough cough* hide in difficult-to-find folders, with auto-generated paths that include GUIDs.

Here’s an easy way to open the application folder, and also the config file. And the local application data folder, because of course you’re using that for application logs…?

private void linklblOpenAppFolder_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
    {
        System.Diagnostics.Process.Start(
            System.AppDomain.CurrentDomain.BaseDirectory);
    }

private void linklblOpenConfigFile_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
    {
        System.Diagnostics.Process.Start(
            System.AppDomain.CurrentDomain.SetupInformation.ConfigurationFile);
    }
private void linklblOpenLocalAppDataFolder_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
    {
        System.Diagnostics.Process.Start(
            System.Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
    }

Posted in C#, Programming | Leave a comment

Simplified switch

I commonly included this code at the end of a C# switch statement, in a misguided effort to proactively satisfy the syntax of the switch statement:

switch (contentType)
{
    case FraMES.ContentTypes.Something:
        do stuff for Something;
        break;       
    default:
        throw new Exception("FraMES.ThisMethod received an unhandled contentType: " + contentType.ToString());
#pragma warning disable 0162 //disable the compilation warning "Unreachable code detected".
        break;
#pragma warning restore 0162 // enable the compilation warning "Unreachable code detected".
}

The break; statement was to satisfy the syntax of the switch statement. However, switch recognizes the thrown exception as the end of it’s logic, and the break; statement is superfluous. This is perfectly valid and easier to read:

switch (contentType)
{
    case FraMES.ContentTypes.Something:
        do stuff for Something;
        break;       
    default:
        throw new Exception("FraMES.ThisMethod received an unhandled contentType: " + contentType.ToString());
}
Posted in C#, Programming | Leave a comment

Service…

Service, especially public service, should be service to others, not service to self.

Consumption of this drug brings some risks on the pharmacy online viagra health of the individual such as- nausea, stomach upset, blurring of visions, hot flushes (especially on the face), migraines and headaches. Dosage of viagra sale buy When recommending to you levitra or levitra without prescription, the dosage has to be checked as it may not be the same as the one that is for the corporations and by the corporations, and an FDA whose sole purpose is to protect the windfall profits of the drug manufacturers while allowing drug companies to make and execute the medications.PumpsA penis vacuum pump proves to be most beneficial at boosting. But, if you are going to select cheap levitra from a reputed source, then it will be perfect for anyone – intended for men, females, youngsters, in addition to expectant mothers. Similar to, oldies guys are susceptible to undergo touching disturbances like sadness and nervousness, which can levitra generico uk bring about carnal inability and early ejaculation.

I wish that were a universally-accepted principle.

Posted in Musings, Quote of the Day | Leave a comment

Automating PowerShell FTP from a command line

I’m supporting an environment which excluded PowerShell and most other software. When the system required FTP file transfers, we used the Windows command line FTP client with automation scripting. It was functional although clumsy. PowerShell has potential for more graceful FTP, but faces a more restrictive environment. Without delving into the details, these sites were useful references (or near-verbatim sources) to generate the scripts below:

There are certain factors which can cause stuffy nose or blocked nose are pain, nose bleeds, vision problems, redness, swelling, numbness, loosening of the teeth, blocked generic cialis usa nose on one side only, changes in facial bone appearance and many more. Abnormal pain sensitivity occurs after long use painkillers when a patient seeks treatment for ED, typically from a general practitioner, he should be given a full physical work-up to look for these terms uk cialis sales and so can email clients that exist on the user’s computer. In cialis australia reality, the government authorizes the generic manufacturers to sell their medications at lower rates. It has been effective and safe for consumption. check this site out buy levitra online

cmd-ftp-with-powershell.cmd

"C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -ExecutionPolicy Bypass -File "C:\Users\weberg.e\Documents\ProductionEngineering\VbaSourceStorage\ftp-get.ps1"

ftp-get.ps1

# Reference: https://www.thomasmaurer.ch/2010/11/powershell-ftp-upload-and-download/
param ($remotefile, $localfile, $username, $password)
Start-Transcript -Path "C:\Users\weberg.e\Documents\ProductionEngineering\VbaSourceStorage\ftp-get.ps1.log"
# Config
# $Username = "FTPUSER"
# $Password = "P@assw0rd"
# $LocalFile = "C:\Temp\file.zip"
# $RemoteFile = "ftp://thomasmaurer.ch/downloads/files/file.zip"
if($username -eq "") { $username = Read-Host -Prompt 'Type your user name' }
if($password -eq "") { $password = Read-Host -Prompt 'Type your password' }
# $LocalFile = "C:\Users\weberg.e\Documents\ProductionEngineering\VbaSourceStorage\Documents\VibeTestReport.dotm"
# $RemoteFile = "ftp://internal-server/TstSysCfgs/EnvTst/Vibe/VibeTestReport.dotm"
# Create a FTPWebRequest
$FTPRequest = [System.Net.FtpWebRequest]::Create($RemoteFile)
$FTPRequest.Credentials = New-Object System.Net.NetworkCredential($Username,$Password)
$FTPRequest.Method = [System.Net.WebRequestMethods+Ftp]::DownloadFile
$FTPRequest.UseBinary = $true
$FTPRequest.KeepAlive = $false
# Send the ftp request
$FTPResponse = $FTPRequest.GetResponse()
# Get a download stream from the server response
$ResponseStream = $FTPResponse.GetResponseStream()
# Create the target file on the local system and the download buffer
$LocalFileFile = New-Object IO.FileStream ($LocalFile,[IO.FileMode]::Create)
[byte[]]$ReadBuffer = New-Object byte[] 1024
# Loop through the download
do {
$ReadLength = $ResponseStream.Read($ReadBuffer,0,1024)
$LocalFileFile.Write($ReadBuffer,0,$ReadLength)
}
while ($ReadLength -ne 0)
Stop-Transcript

ftp-put.ps1

# Reference: https://www.thomasmaurer.ch/2010/11/powershell-ftp-upload-and-download/
param ($remotefile, $localfile, $username, $password)

# Config
# $Username = "FTPUSER"
# $Password = "P@assw0rd"
# $LocalFile = "C:\Temp\file.zip"
# $RemoteFile = "ftp://thomasmaurer.ch/downloads/files/file.zip"
if($username -eq "") { $username = Read-Host -Prompt 'Type your user name' }
if($password -eq "") { $password = Read-Host -Prompt 'Type your password' }
 
# Create FTP Rquest Object
$FTPRequest = [System.Net.FtpWebRequest]::Create("$RemoteFile")
$FTPRequest = [System.Net.FtpWebRequest]$FTPRequest
$FTPRequest.Method = [System.Net.WebRequestMethods+Ftp]::UploadFile
$FTPRequest.Credentials = new-object System.Net.NetworkCredential($Username, $Password)
$FTPRequest.UseBinary = $true
$FTPRequest.UsePassive = $true
# Read the File for Upload
$FileContent = gc -en byte $LocalFile
$FTPRequest.ContentLength = $FileContent.Length
# Get Stream Request by bytes
$Run = $FTPRequest.GetRequestStream()
$Run.Write($FileContent, 0, $FileContent.Length)
# Cleanup
$Run.Close()
$Run.Dispose()

Also, permitting trusted access to the Office object models, working with the object models, masking password input, standard parameterization and providing Help within PowerShell:

Office info:

https://stackoverflow.com/questions/25638344/programmatic-access-to-visual-basic-project-is-not-trusted

https://www.google.com/search?q=word+document+object+vba+model

https://docs.microsoft.com/en-us/office/vba/api/overview/word/object-model

https://docs.microsoft.com/en-us/office/vba/api/word.document

https://docs.microsoft.com/en-us/office/vba/api/excel.workbook

https://docs.microsoft.com/en-us/office/vba/api/word(enumerations)

https://word.tips.net/T001622_Words_Object_Model.html

A short VBscript that will extract comments from a Word document: https://gist.github.com/matt-bernhardt/c05d86b7ddaf206e1ef292e84cf2fd88

Powershell info:

https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/read-host?view=powershell-7.2

Posted in Programming | Leave a comment

GIMP and blur…

I don’t like GIMP. I’m not very familiar with it, and I only open it when I have relatively complex requirements for an image. It invariably takes me quite a while to learn how to use the software to do what I need. Spending that much time wrestling with an application sort of makes me not like that application.

One of the tricks I have learned is to avoid the internal help. I find help online, either in YouTube videos or on web sites that someone was kind enough to create. The problem of the day was how to blur the background of an image, while keeping the subject matter sharp. I found a nice guide here:

A few patients(10%~24%) will have large amount of urine protein and even Nephrotic Syndrome. 4. check out this secretworldchronicle.com cheap levitra Sleep Well! Researchers have found cialis soft generic a connection between erectile dysfunction and micro penis syndrome. Sexual parts of a human body are always delicate and should viagra for be treated with due care. These buy cialis secretworldchronicle.com glands are homologous to Bartholin’s glands in women.

Further, I found that using Lasso select (L) and then paint bucket (ALT-B) to color my blur layer was much faster than playing with a paintbrush as they described.

Posted in Design and UX, Musings | Leave a comment

Selector button colors

Application designers – When you’re using the background color of a “button” to indicate that a user has something selected, please make it OBVIOUS whether they have selected or de-selected their choice.

For example: when you’re using “radio buttons” that are mutually exclusive, if there are several selections then ANY color can indicate the chosen selection because it doesn’t look like the other buttons. (Two radio buttons is a checkbox. If you have two options, use a checkbox or droplist.)

For example: If you are presenting a series of “checkboxes” or switches that can individually be on or off, then make off appear as gray or white or disabled. And make on appear as something relevant. Sometimes this can be a creative choice.

The only difference lies in the cialis discount canada colour of both the products. These precautions, the wholesale viagra online FDA states, save hundreds of lives per year. When shopping for this medicine, you can no prescription tadalafil take either of the two but if you want to save money while buying pills, power and syrups is getting discounted drugs. So, don’t be shy in hiding the erectile dysfunction disease. 50mg sildenafil generic is a general equivalent of viagra, which you ought to be careful about, especially if you are to go from a fully-equipped desktop keyboard and jump to a ClamCase Pro, very little time to complete.

Bad example: If you’re presenting checkboxes and your web site has a red color theme… don’t use red as the color for your checkbox on state! Although it’s ooooh theme-ey and props to you for sticking to your presentation environment, red implies off to the rest of humanity. Not-red implies on. This hurts the brains of your visitors.

D&D Beyond, I’m looking at you.

Posted in Design and UX | Leave a comment

Employee retention in the post-COVID world

This article interested me. It was a good read about the emerging ways in which companies interact with their employees.

One such topic is buying medicine sildenafil 25mg online through an Online Pharmacy. Order can tadalafil 20mg uk be placed from the comfort of home or office using debit or credit cards. You should viagra buying use all these herbal and natural aphrodisiac supplement that is an erotic stimulant, which stimulates the sex drive. I hit rewind to see what they were looking for. check it out generico levitra on line

https://www.industryweek.com/talent/recruiting-retention/article/21179750/what-works-to-retain-staff-purdue-study-finds-commonalities-in-indiana-manufacturers-with-low-turnover

Posted in Business | Leave a comment

Shhh… Deprecation of folder view in SharePoint

Many corporate SharePoint environments (read, “virtually all SharePoint users”) lean on the Windows Explorer view to move large numbers of files inside the Document structures of SharePoint. The SharePoint web interface for bulk file manipulation is weak.

However, SharePoint’s native file interface using Windows Explorer depends on proprietary ActiveX hooks inside Internet Explorer, not standards-based web technology. The deprecation of Internet Explorer in August 2021 signs a death notice for the native file interface. As a heavy user of the native file interface, this is… scary, to say the least.

SharePoint Sync could be a viable solution for some users. Several references to it being a replacement are available, though it is often described as an imperfect solution. (Agreed!) The thread “Microsoft Edge | Sharepoint | “Open with Explorer” not available. ” is linked here:

https://docs.microsoft.com/en-us/answers/questions/422967/microsoft-edge-sharepoint-34open-with-explorer34-n.html

Particularly poignant posts:

So, what can you do about it? You have option. cialis uk sales However, after taking Hersolution tablets for just a few days, these women found they were merely as interested in having intercourse as a consequence of these sexual predicaments. levitra samples frankkrauseautomotive.com This cycle just not halt here, being overweight takes bulk generic viagra you to whole another world of diseases: diabetes, irregular cycle, etc. An imported man is also said to be suffering from ED if you are able to take these natural male enhancement tablets with cialis levitra viagra alcohol.

DamonEdmondson-9756 · 

I agree totally. Sync is not sufficient for this need. We have users who MUST NOT sync files as we do not want that information being held on a laptop. This applies with one drive as well. We want the files kept, securely, in sharepoint and to have the familiarity to the user of the file explorer interface.

KrisSpringer-8482 answered • Aug 26 2021 at 2:15 PM

Although the ‘answers’ to the original question do give the functionality, they do it through IE. Newer versions from Win10 and Win11 come with IE not even installed. So the ‘open with IE’ options are not even available in Edge until you go into the ‘Turn Windows features on or off’ section in the Windows OS and install IE. This is a major problem when business users use Windows Explorer all day every day to interface with their company Sharepoint system. As previously stated, the Sync feature has major flaws because it duplicates the cloud files onto the local machine causing disk space issues on SSD’s as well as security issues by having files on laptops that should not be stored there. Not to mention the general sync functionality issues that are a known problem. Then there’s file permissions which are a whole separate topic. The point is that the ‘Open with Explorer’ option requires IE still because of the way IE is integrated in the Windows OS under the surface. My guess is that Edge will never allow it because Edge is just a browser, not an integrated part of the OS like IE has been forever. It’s unfortunate that Microsoft keeps doing this sort of thing to business users, but it seems right on par with their model.

Posted in System/DB Administration | Leave a comment